com.bigdata.io
Interface IByteArrayBuffer

All Superinterfaces:
IByteArraySlice, IDataRecord
All Known Implementing Classes:
ByteArrayBuffer, DataOutputBuffer

public interface IByteArrayBuffer
extends IDataRecord

An interface for reading from and accessing a managed byte[]. Implementations of this interface may permit transparent extension of the managed byte[].

Version:
$Id: IByteArrayBuffer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
raise mark(), etc. into this interface?

Method Summary
 byte[] array()
          The backing byte[] WILL be transparently replaced if the buffer capacity is extended.
 int capacity()
          The capacity of the buffer.
 int len()
          The length of the slice is always the capacity of the backing byte[].
 int limit()
          The read limit (there is no write limit on the buffer since the capacity will be automatically extended on overflow).
 int off()
          The offset of the slice into the backing byte[] is always zero.
 int pos()
          The current position in the buffer.
 int remaining()
          The #of bytes remaining in the buffer before it would overflow.
 
Methods inherited from interface com.bigdata.io.IDataRecord
asByteBuffer, get, get, getBit, getByte, getDouble, getFloat, getInt, getLong, getShort, put, put, putByte, putDouble, putFloat, putInt, putLong, putShort, setBit, slice, toByteArray
 

Method Detail

array

byte[] array()
The backing byte[] WILL be transparently replaced if the buffer capacity is extended. The backing byte[]. This method DOES NOT guarantee that the backing array reference will remain constant. Some implementations use an extensible backing byte[] and will replace the reference when the backing buffer is extended.

Specified by:
array in interface IByteArraySlice

off

int off()
The offset of the slice into the backing byte[] is always zero. The start of the slice in the IByteArraySlice.array().

Specified by:
off in interface IByteArraySlice

len

int len()
The length of the slice is always the capacity of the backing byte[]. The length of the slice in the IByteArraySlice.array().

Specified by:
len in interface IByteArraySlice

capacity

int capacity()
The capacity of the buffer.


pos

int pos()
The current position in the buffer.

Note: The method name was choose to avoid a collision with RepositionableStream.position().


limit

int limit()
The read limit (there is no write limit on the buffer since the capacity will be automatically extended on overflow).


remaining

int remaining()
The #of bytes remaining in the buffer before it would overflow.



Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.