Android Guides | Samples

Java.Nio.ByteBuffer Class

A buffer for bytes.

See Also: ByteBuffer

Syntax

[Android.Runtime.Register("java/nio/ByteBuffer", DoNotGenerateAcw=true)]
public abstract class ByteBuffer : Buffer, IComparable, IDisposable

Remarks

A buffer for bytes.

A byte buffer can be created in either one of the following ways:

[Android Documentation]

Requirements

Namespace: Java.Nio
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Nio.ByteBuffer are listed below.

See Also: Buffer

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
abstract
CharChar. Returns the char at the current position and increases the position by 2.
[read-only]
abstract
DoubleDouble. Returns the double at the current position and increases the position by 8.
[read-only]
abstract
FloatSingle. Returns the float at the current position and increases the position by 4.
[read-only]
override
HasArrayBoolean. Returns true if array and arrayOffset won't throw.
[read-only]
abstract
IntInt32. Returns the int at the current position and increases the position by 4.
[read-only]
abstract
LongInt64. Returns the long at the current position and increases the position by 8.
[read-only]
abstract
ShortInt16. Returns the short at the current position and increases the position by 2.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

static
Allocate(Int32) : ByteBuffer
Creates a byte buffer based on a newly allocated byte array.
static
AllocateDirect(Int32) : ByteBuffer
Creates a direct byte buffer based on a newly allocated memory block.
override
ArrayOffset() : Int32
Returns the offset of the byte array which this buffer is based on, if there is one.
abstract
AsCharBuffer() : CharBuffer
Returns a char buffer which is based on the remaining content of this byte buffer.
abstract
AsDoubleBuffer() : DoubleBuffer
Returns a double buffer which is based on the remaining content of this byte buffer.
abstract
AsFloatBuffer() : FloatBuffer
Returns a float buffer which is based on the remaining content of this byte buffer.
abstract
AsIntBuffer() : IntBuffer
Returns a int buffer which is based on the remaining content of this byte buffer.
abstract
AsLongBuffer() : LongBuffer
Returns a long buffer which is based on the remaining content of this byte buffer.
abstract
AsReadOnlyBuffer() : ByteBuffer
Returns a read-only buffer that shares its content with this buffer.
abstract
AsShortBuffer() : ShortBuffer
Returns a short buffer which is based on the remaining content of this byte buffer.
abstract
Compact() : ByteBuffer
Compacts this byte buffer.
CompareTo(ByteBuffer) : Int32
Compares the remaining bytes of this buffer to another byte buffer's remaining bytes.
abstract
Duplicate() : ByteBuffer
Returns a duplicated buffer that shares its content with this buffer.
abstract
Get() : SByte
Returns the byte at the current position and increases the position by 1.
Get(Byte[]) : ByteBuffer
Reads bytes from the current position into the specified byte array and increases the position by the number of bytes read.
abstract
Get(Int32) : SByte
Returns the byte at the specified index and does not change the position.
Get(Byte[], Int32, Int32) : ByteBuffer
Reads bytes from the current position into the specified byte array, starting at the specified offset, and increases the position by the number of bytes read.
abstract
GetChar(Int32) : Char
Returns the char at the specified index.
abstract
GetDouble(Int32) : Double
Returns the double at the specified index.
abstract
GetFloat(Int32) : Single
Returns the float at the specified index.
abstract
GetInt(Int32) : Int32
Returns the int at the specified index.
abstract
GetLong(Int32) : Int64
Returns the long at the specified index.
abstract
GetShort(Int32) : Int16
Returns the short at the specified index.
Order() : ByteOrder
Returns the byte order used by this buffer when converting bytes from/to other primitive types.
Order(ByteOrder) : ByteBuffer
Sets the byte order of this buffer.
Put(ByteBuffer) : ByteBuffer
Writes all the remaining bytes of the src byte buffer to this buffer's current position, and increases both buffers' position by the number of bytes copied.
Put(Byte[]) : ByteBuffer
Writes bytes in the given byte array to the current position and increases the position by the number of bytes written.
abstract
Put(SByte) : ByteBuffer
Writes the given byte to the current position and increases the position by 1.
abstract
Put(Int32, SByte) : ByteBuffer
Write a byte to the specified index of this buffer without changing the position.
Put(Byte[], Int32, Int32) : ByteBuffer
Writes bytes in the given byte array, starting from the specified offset, to the current position and increases the position by the number of bytes written.
abstract
PutChar(Char) : ByteBuffer
Writes the given char to the current position and increases the position by 2.
abstract
PutChar(Int32, Char) : ByteBuffer
Writes the given char to the specified index of this buffer.
abstract
PutDouble(Double) : ByteBuffer
Writes the given double to the current position and increases the position by 8.
abstract
PutDouble(Int32, Double) : ByteBuffer
Writes the given double to the specified index of this buffer.
abstract
PutFloat(Single) : ByteBuffer
Writes the given float to the current position and increases the position by 4.
abstract
PutFloat(Int32, Single) : ByteBuffer
Writes the given float to the specified index of this buffer.
abstract
PutInt(Int32) : ByteBuffer
Writes the given int to the current position and increases the position by 4.
abstract
PutInt(Int32, Int32) : ByteBuffer
Writes the given int to the specified index of this buffer.
abstract
PutLong(Int64) : ByteBuffer
Writes the given long to the current position and increases the position by 8.
abstract
PutLong(Int32, Int64) : ByteBuffer
Writes the given long to the specified index of this buffer.
abstract
PutShort(Int16) : ByteBuffer
Writes the given short to the current position and increases the position by 2.
abstract
PutShort(Int32, Int16) : ByteBuffer
Writes the given short to the specified index of this buffer.
abstract
Slice() : ByteBuffer
Returns a sliced buffer that shares its content with this buffer.
static
Wrap(Byte[]) : ByteBuffer
Creates a new byte buffer by wrapping the given byte array.
static
Wrap(Byte[], Int32, Int32) : ByteBuffer
Creates a new byte buffer by wrapping the given byte array.

Explicitly Implemented Interface Members