# Class: com.pnfsoftware.jeb.util.io.ByteBufferUtil

Utility methods for [ByteBuffer](ByteBuffer)s.

## Constructor: ByteBufferUtil


## Static Method: align
- parameter: `b`, type: `java.nio.ByteBuffer`
- parameter: `align`, type: `int`
- return type: `int`

Description: Align the buffer using the provided byte alignment. The position will be increased from anything from 0 to ALIGN\-1 bytes so that the new position is congurent to 0 \(modulo N\).
parameter: b: 
parameter: align: must be \>= 1
return: the buffer's new position

## Static Method: equalsByteArray
- parameter: `b`, type: `java.nio.ByteBuffer`
- parameter: `bufferOffset`, type: `int`
- parameter: `a`, type: `byte[]`
- parameter: `arrayOffset`, type: `int`
- parameter: `size`, type: `int`
- return type: `boolean`

Description: Compare bytes of a buffer against the bytes of an array.
parameter: b: source buffer
parameter: bufferOffset: offset in buffer
parameter: a: source array
parameter: arrayOffset: offset in array
parameter: size: number to bytes to be compared
return: true on equality

## Static Method: getBytes
- parameter: `b`, type: `java.nio.ByteBuffer`
- parameter: `offset`, type: `int`
- parameter: `size`, type: `int`
- return type: `byte[]`

Description: Extract a sequence of bytes from a buffer into a newly\-created byte array.
parameter: b: 
parameter: offset: offset in \`b\` \(\!\)
parameter: size: number of bytes to read, from \`b.position\(\)\`
return: 

## Static Method: getBytes
- parameter: `b`, type: `java.nio.ByteBuffer`
- return type: `byte[]`

Description: Read the remaining bytes of a buffer.
parameter: b: 
return: 

## Static Method: getUnsignedInt
- parameter: `b`, type: `java.nio.ByteBuffer`
- return type: `long`

Description: Unpack a 4\-byte int and zero\-extend it to a long.
parameter: b: 
return: 

## Static Method: getUnsignedInt
- parameter: `b`, type: `java.nio.ByteBuffer`
- parameter: `index`, type: `int`
- return type: `long`

Description: Unpack a 4\-byte int and zero\-extend it to a long.
parameter: b: 
parameter: index: 
return: 

## Static Method: skip
- parameter: `b`, type: `java.nio.ByteBuffer`
- parameter: `n`, type: `int`

Description: Skip bytes, including "backward skipping". An exception is raised if the exact amount of bytes could not be skipped.
parameter: b: buffer
parameter: n: number of bytes to skip \(move forward\); can be negative to partially rewind the            pointer

## Static Method: skipAttempt
- parameter: `b`, type: `java.nio.ByteBuffer`
- parameter: `n`, type: `int`
- return type: `int`

Description: Attempt to skip bytes, including "backward skipping".
parameter: b: buffer
parameter: n: number of bytes to skip
return: the number of bytes skipped.

## Static Method: skipToEnd
- parameter: `b`, type: `java.nio.ByteBuffer`

Description: Go to the end of the buffer.
parameter: b: buffer

## Static Method: wrapBE
- parameter: `array`, type: `byte[]`
- return type: `java.nio.ByteBuffer`

Description: Wrap the provided bytes in a big\-endian buffer.
parameter: array: 
return: 

## Static Method: wrapBE
- parameter: `array`, type: `byte[]`
- parameter: `offset`, type: `int`
- parameter: `length`, type: `int`
- return type: `java.nio.ByteBuffer`

Description: Wrap the provided bytes in a big\-endian buffer.
parameter: array: 
parameter: offset: 
parameter: length: 
return: 

## Static Method: wrapLE
- parameter: `array`, type: `byte[]`
- return type: `java.nio.ByteBuffer`

Description: Wrap the provided bytes in a little\-endian buffer.
parameter: array: 
return: 

## Static Method: wrapLE
- parameter: `array`, type: `byte[]`
- parameter: `offset`, type: `int`
- parameter: `length`, type: `int`
- return type: `java.nio.ByteBuffer`

Description: Wrap the provided bytes in a little\-endian buffer.
parameter: array: 
parameter: offset: 
parameter: length: 
return: 

