|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvu.ByteVector
public final class ByteVector
This class implements a block vector of bytes.
Field Summary | |
---|---|
static int |
blocksizeDefault
The default size of each block. |
Constructor Summary | |
---|---|
ByteVector()
Creates a new ByteVector object. |
|
ByteVector(int blocksize)
Creates a new ByteVector object. |
Method Summary | |
---|---|
void |
addByte(byte value)
Append a byte to the vector. |
java.lang.Object |
clone()
Create a copy by value of this vector. |
int |
getBlocksize()
Query the blocksize used for this object. |
byte |
getByte(int position)
Query the byte value at a particular offset. |
int |
getBytes(int position,
byte[] data,
int offset,
int size)
Copy a range of byte values. |
int |
readData(java.io.InputStream input,
int size)
Read data into the buffer. |
void |
setByte(int position,
byte value)
Set a byte at a particular position. |
int |
size()
Query the size of this vector. |
byte[] |
toByteArray()
Convert the vector to a byte array. |
byte[] |
toByteArray(int start,
int end)
Convert this vector to a byte array |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int blocksizeDefault
Constructor Detail |
---|
public ByteVector(int blocksize)
blocksize
- DOCUMENT ME!public ByteVector()
Method Detail |
---|
public int getBlocksize()
public void setByte(int position, byte value) throws java.lang.ArrayIndexOutOfBoundsException
position
- data offset to setvalue
- data value to set
java.lang.ArrayIndexOutOfBoundsException
- if the position is outside the valid rangepublic byte getByte(int position)
position
- data offset to query
java.lang.ArrayIndexOutOfBoundsException
- if the position is outside the valid rangepublic int getBytes(int position, byte[] data, int offset, int size)
position
- data offset to start copyingdata
- byte array to copy data tooffset
- byte array offset to start copying tosize
- maximum number of bytes to copy
public void addByte(byte value)
value
- byte value to appendpublic java.lang.Object clone()
clone
in class java.lang.Object
public int readData(java.io.InputStream input, int size) throws java.io.IOException
input
- stream to readsize
- maximum amount of data to read
java.io.IOException
- if an error occurspublic int size()
public byte[] toByteArray(int start, int end)
start
- position to start copying fromend
- position to copy to
public byte[] toByteArray()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |