Method | Description | |
---|---|---|
Allocate ( int capacity ) : ByteBuffer |
Allocates a new byte buffer. The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined. It will have a backing array, and its array offset will be zero.
|
|
Append ( byte src ) : void |
Appends a byte buffer to this ByteArray.
|
|
Append ( byte src, int offset, int length ) : void |
Appends a byte buffer to this ByteArray.
|
|
ByteBuffer ( |
Initializes a new instance of the ByteBuffer class.
|
|
Clear ( ) : void |
Clears this buffer. The position is set to zero, the limit is set to the capacity, and the mark is discarded.
|
|
ClearBookmark ( ) : void |
Clears the current bookmark.
|
|
Close ( ) : void |
Closes the current stream and releases any resources associated with the current stream.
|
|
Compact ( ) : void |
Compacts this buffer The bytes between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the byte at index p = position() is copied to index zero, the byte at index p + 1 is copied to index one, and so forth until the byte at index limit() - 1 is copied to index n = limit() - 1 - p. The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded. The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.
|
|
Dump ( string file ) : void |
Write the buffer content to a file.
|
|
Equals ( object obj ) : bool |
Tells whether or not this buffer is equal to another object.
|
|
Fill ( byte value, int count ) : void |
Fills this buffer with the specified value.
|
|
Flip ( ) : void |
Flips this buffer. The limit is set to the current position and then the position is set to zero. If the mark is defined then it is discarded.
|
|
Flush ( ) : void |
Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
|
|
Get ( ) : byte |
Relative get method. Reads the byte at this buffer's current position, and then increments the position.
|
|
Get ( int index ) : byte |
Absolute get method. Reads the byte at the given index.
|
|
Get ( byte dst ) : void |
Relative bulk get method.
|
|
GetBuffer ( ) : byte[] |
Returns the array of unsigned bytes from which this stream was created.
|
|
GetHashCode ( ) : int |
Returns the current hash code of this buffer.
|
|
GetInt ( ) : int |
Reads a 4-byte signed integer using network byte order encoding.
|
|
GetShort ( ) : short |
Reads a 2-byte signed integer using network byte order encoding.
|
|
Mark ( ) : long |
Sets this buffer's bookmark at its position.
|
|
Put ( ByteBuffer output, ByteBuffer input, int numBytesMax ) : int |
Puts an in buffer stream onto an out buffer stream and returns the bytes written.
|
|
Put ( ByteBuffer src ) : void |
This method transfers the bytes remaining in the given source buffer into this buffer. If there are more bytes remaining in the source buffer than in this buffer, that is, if src.remaining() > remaining(), then no bytes are transferred and a BufferOverflowException is thrown. Otherwise, this method copies n = src.remaining() bytes from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by n.
|
|
Put ( ByteBuffer src, int count ) : void |
Transfers the specified number of bytes from the given source buffer into this buffer.
|
|
Put ( byte value ) : void |
Writes the given byte into this buffer at the current position, and then increments the position.
|
|
Put ( byte src, int offset, int length ) : void |
Relative bulk put method. This method transfers bytes into this buffer from the given source array. If there are more bytes to be copied from the array than remain in this buffer, that is, if length > remaining(), then no bytes are transferred and a BufferOverflowException is thrown. Otherwise, this method copies length bytes from the given array into this buffer, starting at the given offset in the array and at the current position of this buffer. The position of this buffer is then incremented by length.
|
|
Put ( int index, |
||
Put ( int index, |
Absolute put method for writing an int value. Writes four bytes containing the given int value, in the current byte order, into this buffer at the given index.
|
|
Put ( int index, byte value ) : void |
Absolute put method. Writes the given byte into this buffer at the given index.
|
|
PutInt ( int value ) : void |
Relative put method for writing an int value. Writes four bytes containing the given int value, in the current byte order, into this buffer at the current position, and then increments the position by four.
|
|
PutInt ( int index, int value ) : void |
Absolute put method for writing an int value. Writes four bytes containing the given int value, in the current byte order, into this buffer at the given index.
|
|
PutShort ( short value ) : void |
Writes a 16-bit unsigned integer to the current position.
|
|
Read ( byte buffer ) : int |
Relative bulk get method. This method transfers bytes from this buffer into the given destination array. An invocation of this method behaves in exactly the same way as the invocation buffer.Get(a, 0, a.Length)
|
|
Read ( byte buffer, int offset, int count ) : int |
Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
|
|
ReadByte ( ) : int |
Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
|
|
ReadBytes ( int count ) : byte[] |
Reads count bytes from the current stream into a byte array and advances the current position by count bytes.
|
|
ReadReverseInt ( ) : int |
Reads a 4-byte signed integer.
|
|
ReadUInt24 ( ) : int | ||
Reset ( ) : void |
Resets this buffer's position to the previously-marked position. Invoking this method neither changes nor discards the mark's value.
|
|
Rewind ( ) : void |
Rewinds this buffer. The position is set to zero and the mark is discarded.
|
|
Seek ( long offset, SeekOrigin origin ) : long |
Sets the position within the current stream.
|
|
SetLength ( long value ) : void |
Sets the length of the current stream.
|
|
Skip ( int size ) : void |
Forwards the position of this buffer as the specified size bytes.
|
|
ToArray ( ) : byte[] |
Writes the stream contents to a byte array, regardless of the Position property. This method omits unused bytes in ByteBuffer from the array. To get the entire buffer, use the GetBuffer method. |
|
ToString ( ) : string |
Returns a string summarizing the state of this buffer.
|
|
Wrap ( byte array ) : ByteBuffer |
Wraps a byte array into a buffer. The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be array.length, its position will be zero, and its mark will be undefined.
|
|
Wrap ( byte array, int offset, int length ) : ByteBuffer |
Wraps a byte array into a buffer. The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined.
|
|
Write ( byte buffer, int offset, int count ) : void |
Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
|
|
WriteByte ( byte value ) : void |
Writes a byte to the current position in the stream and advances the position within the stream by one byte.
|
|
WriteMediumInt ( int value ) : void |
Writes a 32-bit signed integer to the current position using variable length unsigned 29-bit integer encoding.
|
|
WriteReverseInt ( int value ) : void | ||
this ( int index ) : byte |
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Releases all resources used by this object.
|
Method | Description | |
---|---|---|
WriteBigEndian ( byte bytes ) : void | ||
WriteBigEndian ( int index, byte bytes ) : void | ||
WriteBytes ( int index, byte bytes ) : void |
public static Allocate ( int capacity ) : ByteBuffer | ||
capacity | int | |
return | ByteBuffer |
public Append ( byte src ) : void | ||
src | byte | The byte buffer to append. |
return | void |
public Append ( byte src, int offset, int length ) : void | ||
src | byte | The byte buffer to append. |
offset | int | Offset in the byte buffer. |
length | int | Number of bytes to append. |
return | void |
public ByteBuffer ( |
||
stream | Wraps the MemoryStream into a buffer. | |
return | System |
protected Dispose ( bool disposing ) : void | ||
disposing | bool | Indicates if this is a dispose call dispose. |
return | void |
public Equals ( object obj ) : bool | ||
obj | object | The object to which this buffer is to be compared |
return | bool |
public static Put ( ByteBuffer output, ByteBuffer input, int numBytesMax ) : int | ||
output | ByteBuffer | |
input | ByteBuffer | |
numBytesMax | int | |
return | int |
public Put ( ByteBuffer src ) : void | ||
src | ByteBuffer | The source buffer from which bytes are to be read; must not be this buffer. |
return | void |
public Put ( ByteBuffer src, int count ) : void | ||
src | ByteBuffer | The source buffer from which bytes are to be read; must not be this buffer. |
count | int | Number of bytes to transfer. |
return | void |
public Put ( byte src, int offset, int length ) : void | ||
src | byte | The array from which bytes are to be read. |
offset | int | The offset within the array of the first byte to be read; must be non-negative and no larger than the array length. |
length | int | The number of bytes to be read from the given array; must be non-negative and no larger than length - offset. |
return | void |
public Put ( int index, |
||
index | int | |
value | ||
return | void |
public Put ( int index, |
||
index | int | The index at which the bytes will be written. |
value | The int value to be written. | |
return | void |
public Put ( int index, byte value ) : void | ||
index | int | The index. |
value | byte | The byte to write. |
return | void |
public PutInt ( int value ) : void | ||
value | int | The int value to be written. |
return | void |
public PutInt ( int index, int value ) : void | ||
index | int | The index at which the bytes will be written. |
value | int | The int value to be written. |
return | void |
public PutShort ( short value ) : void | ||
value | short | A 16-bit unsigned integer. |
return | void |
public Read ( byte buffer, int offset, int count ) : int | ||
buffer | byte | An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. |
offset | int | The zero-based byte offset in buffer at which to begin storing the data read from the current stream. |
count | int | The maximum number of bytes to be read from the current stream. |
return | int |
public Seek ( long offset, SeekOrigin origin ) : long | ||
offset | long | A byte offset relative to the origin parameter. |
origin | SeekOrigin | A value of type SeekOrigin indicating the reference point used to obtain the new position. |
return | long |
public SetLength ( long value ) : void | ||
value | long | The desired length of the current stream in bytes. |
return | void |
public static Wrap ( byte array ) : ByteBuffer | ||
array | byte | |
return | ByteBuffer |
public static Wrap ( byte array, int offset, int length ) : ByteBuffer | ||
array | byte | Byte array to wrap. |
offset | int | Offset in the byte array. |
length | int | |
return | ByteBuffer |
public Write ( byte buffer, int offset, int count ) : void | ||
buffer | byte | An array of bytes. This method copies count bytes from buffer to the current stream. |
offset | int | The zero-based byte offset in buffer at which to begin copying bytes to the current stream. |
count | int | The number of bytes to be written to the current stream. |
return | void |
public WriteByte ( byte value ) : void | ||
value | byte | The byte to write to the stream. |
return | void |
public WriteMediumInt ( int value ) : void | ||
value | int | A 32-bit signed integer. |
return | void |