ByteBuffer ByteBuffer Class

Definition

A buffer for bytes.

[Android.Runtime.Register("java/nio/ByteBuffer", ApiSince=1, DoNotGenerateAcw=true)]
public abstract class ByteBuffer : Java.Nio.Buffer, IDisposable, Java.Lang.IComparable
type ByteBuffer = class
    inherit Buffer
    interface IComparable
    interface IJavaObject
    interface IDisposable
Inheritance
Derived
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

ByteBuffer(IntPtr, JniHandleOwnership) ByteBuffer(IntPtr, JniHandleOwnership)

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

Properties

Char Char

Returns the char at the current position and increases the position by 2.

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Double Double

Returns the double at the current position and increases the position by 8.

Float Float

Returns the float at the current position and increases the position by 4.

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasArray HasArray

Returns true if array and arrayOffset won't throw.

HasRemaining HasRemaining

Indicates if there are elements remaining in this buffer, that is if position .

(Inherited from Buffer)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
Int Int

Returns the int at the current position and increases the position by 4.

IsDirect IsDirect

Returns true if this is a direct buffer.

(Inherited from Buffer)
IsReadOnly IsReadOnly

Indicates whether this buffer is read-only.

(Inherited from Buffer)
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
Long Long

Returns the long at the current position and increases the position by 8.

PeerReference PeerReference Inherited from Object
Short Short

Returns the short at the current position and increases the position by 2.

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Allocate(Int32) Allocate(Int32)

Creates a byte buffer based on a newly allocated byte array.

AllocateDirect(Int32) AllocateDirect(Int32)

Creates a direct byte buffer based on a newly allocated memory block.

ArrayOffset() ArrayOffset()

Returns the offset of the byte array which this buffer is based on, if there is one.

AsCharBuffer() AsCharBuffer()

Returns a char buffer which is based on the remaining content of this byte buffer.

AsDoubleBuffer() AsDoubleBuffer()

Returns a double buffer which is based on the remaining content of this byte buffer.

AsFloatBuffer() AsFloatBuffer()

Returns a float buffer which is based on the remaining content of this byte buffer.

AsIntBuffer() AsIntBuffer()

Returns a int buffer which is based on the remaining content of this byte buffer.

AsLongBuffer() AsLongBuffer()

Returns a long buffer which is based on the remaining content of this byte buffer.

AsReadOnlyBuffer() AsReadOnlyBuffer()

Returns a read-only buffer that shares its content with this buffer.

AsShortBuffer() AsShortBuffer()

Returns a short buffer which is based on the remaining content of this byte buffer.

Capacity() Capacity()

Returns the capacity of this buffer.

(Inherited from Buffer)
Clear() Clear()

Clears this buffer.

(Inherited from Buffer)
Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Compact() Compact()

Compacts this byte buffer.

CompareTo(ByteBuffer) CompareTo(ByteBuffer)

Compares the remaining bytes of this buffer to another byte buffer's remaining bytes.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Duplicate() Duplicate()

Returns a duplicated buffer that shares its content with this buffer.

Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
Flip() Flip()

Flips this buffer.

(Inherited from Buffer)
Get() Get()

Returns the byte at the current position and increases the position by 1.

Get(Byte[]) Get(Byte[])

Reads bytes from the current position into the specified byte array and increases the position by the number of bytes read.

Get(Byte[], Int32, Int32) Get(Byte[], Int32, Int32)

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.

Get(Int32) Get(Int32)

Returns the byte at the specified index and does not change the position.

GetChar(Int32) GetChar(Int32)

Returns the char at the specified index.

GetDirectBufferAddress() GetDirectBufferAddress() Inherited from Buffer
GetDouble(Int32) GetDouble(Int32)

Returns the double at the specified index.

GetFloat(Int32) GetFloat(Int32)

Returns the float at the specified index.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetInt(Int32) GetInt(Int32)

Returns the int at the specified index.

GetLong(Int32) GetLong(Int32)

Returns the long at the specified index.

GetShort(Int32) GetShort(Int32)

Returns the short at the specified index.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Limit() Limit()

Returns the limit of this buffer.

(Inherited from Buffer)
Limit(Int32) Limit(Int32)

Sets the limit of this buffer.

(Inherited from Buffer)
Mark() Mark()

Marks the current position, so that the position may return to this point later by calling reset().

(Inherited from Buffer)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
Order() Order()

Returns the byte order used by this buffer when converting bytes from/to other primitive types.

Order(ByteOrder) Order(ByteOrder)

Sets the byte order of this buffer.

Position() Position()

Returns the position of this buffer.

(Inherited from Buffer)
Position(Int32) Position(Int32)

Sets the position of this buffer.

(Inherited from Buffer)
Put(ByteBuffer) Put(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[]) Put(Byte[])

Writes bytes in the given byte array to the current position and increases the position by the number of bytes written.

Put(Byte[], Int32, Int32) Put(Byte[], Int32, Int32)

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.

Put(Int32, SByte) Put(Int32, SByte)

Write a byte to the specified index of this buffer without changing the position.

Put(SByte) Put(SByte)

Writes the given byte to the current position and increases the position by 1.

PutChar(Char) PutChar(Char)

Writes the given char to the current position and increases the position by 2.

PutChar(Int32, Char) PutChar(Int32, Char)

Writes the given char to the specified index of this buffer.

PutDouble(Double) PutDouble(Double)

Writes the given double to the current position and increases the position by 8.

PutDouble(Int32, Double) PutDouble(Int32, Double)

Writes the given double to the specified index of this buffer.

PutFloat(Int32, Single) PutFloat(Int32, Single)

Writes the given float to the specified index of this buffer.

PutFloat(Single) PutFloat(Single)

Writes the given float to the current position and increases the position by 4.

PutInt(Int32) PutInt(Int32)

Writes the given int to the current position and increases the position by 4.

PutInt(Int32, Int32) PutInt(Int32, Int32)

Writes the given int to the specified index of this buffer.

PutLong(Int32, Int64) PutLong(Int32, Int64)

Writes the given long to the specified index of this buffer.

PutLong(Int64) PutLong(Int64)

Writes the given long to the current position and increases the position by 8.

PutShort(Int16) PutShort(Int16)

Writes the given short to the current position and increases the position by 2.

PutShort(Int32, Int16) PutShort(Int32, Int16)

Writes the given short to the specified index of this buffer.

Remaining() Remaining()

Returns the number of remaining elements in this buffer, that is limit - position.

(Inherited from Buffer)
Reset() Reset()

Resets the position of this buffer to the mark.

(Inherited from Buffer)
Rewind() Rewind()

Rewinds this buffer.

(Inherited from Buffer)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Slice() Slice()

Returns a sliced buffer that shares its content with this buffer.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wrap(Byte[]) Wrap(Byte[])

Creates a new byte buffer by wrapping the given byte array.

Wrap(Byte[], Int32, Int32) Wrap(Byte[], Int32, Int32)

Creates a new byte buffer by wrapping the given byte array.

Explicit Interface Implementations

IComparable.CompareTo(Object) IComparable.CompareTo(Object)
IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to