Top Description Fields Constructors Methods
javax.imageio.stream

public Class IIOByteBuffer

extends Object
Class Inheritance

A class representing a mutable reference to an array of bytes and an offset and length within that array. IIOByteBuffer is used by ImageInputStream to supply a sequence of bytes to the caller, possibly with fewer copies than using the conventional read methods that take a user-supplied byte array.

The byte array referenced by an IIOByteBuffer will generally be part of an internal data structure belonging to an ImageReader implementation; its contents should be considered read-only and must not be modified.

Field Summary

Modifier and TypeField and Description
private byte[]
private int
private int

Constructor Summary

AccessConstructor and Description
public
IIOByteBuffer(byte[]
a byte array.
data
,
int
an int offset within the array.
offset
,
int
an int specifying the length of the data of interest within byte array, in bytes.
length
)

Constructs an IIOByteBuffer that references a given byte array, offset, and length.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

a byte array reference.
getData
()

Returns a reference to the byte array.

public int

Returns:

an int length.
getLength
()

Returns the length of the data of interest within the byte array returned by getData.

public int

Returns:

an int offset.
getOffset
()

Returns the offset within the byte array returned by getData at which the data of interest start.

public void
setData(byte[]
a byte array reference containing the new data value.
data
)

Updates the array reference that will be returned by subsequent calls to the getData method.

public void
setLength(int
an int containing the new length value.
length
)

Updates the value that will be returned by subsequent calls to the getLength method.

public void
setOffset(int
an int containing the new offset value.
offset
)

Updates the value that will be returned by subsequent calls to the getOffset method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private byte[] data
lengthback to summary
private int length
offsetback to summary
private int offset

Constructor Detail

IIOByteBufferback to summary
public IIOByteBuffer(byte[] data, int offset, int length)

Constructs an IIOByteBuffer that references a given byte array, offset, and length.

Parameters
data:byte[]

a byte array.

offset:int

an int offset within the array.

length:int

an int specifying the length of the data of interest within byte array, in bytes.

Method Detail

getDataback to summary
public byte[] getData()

Returns a reference to the byte array. The returned value should be treated as read-only, and only the portion specified by the values of getOffset and getLength should be used.

Returns:byte[]

a byte array reference.

See Also
getOffset, getLength, setData
getLengthback to summary
public int getLength()

Returns the length of the data of interest within the byte array returned by getData.

Returns:int

an int length.

See Also
getData, getOffset, setLength
getOffsetback to summary
public int getOffset()

Returns the offset within the byte array returned by getData at which the data of interest start.

Returns:int

an int offset.

See Also
getData, getLength, setOffset
setDataback to summary
public void setData(byte[] data)

Updates the array reference that will be returned by subsequent calls to the getData method.

Parameters
data:byte[]

a byte array reference containing the new data value.

See Also
getData
setLengthback to summary
public void setLength(int length)

Updates the value that will be returned by subsequent calls to the getLength method.

Parameters
length:int

an int containing the new length value.

See Also
getLength
setOffsetback to summary
public void setOffset(int offset)

Updates the value that will be returned by subsequent calls to the getOffset method.

Parameters
offset:int

an int containing the new offset value.

See Also
getOffset