|
PDF Clown 0.1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfclown.bytes.Buffer
public final class Buffer
Byte buffer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.pdfclown.bytes.IBuffer |
---|
IBuffer.IListener |
Constructor Summary | |
---|---|
Buffer()
|
|
Buffer(BufferedReader dataStream)
|
|
Buffer(byte[] data)
|
|
Buffer(byte[] data,
ByteOrder byteOrder)
|
|
Buffer(InputStream dataStream)
|
|
Buffer(int capacity)
|
Method Summary | |
---|---|
void |
addListener(IBuffer.IListener listener)
Adds the specified listener. |
IBuffer |
append(byte data)
Appends a byte to the buffer. |
IBuffer |
append(byte[] data)
Appends a byte array to the buffer. |
IBuffer |
append(byte[] data,
int offset,
int length)
Appends a byte range to the buffer. |
IBuffer |
append(IInputStream data)
Appends an IInputStream to the buffer. |
IBuffer |
append(String data)
Appends a string to the buffer. |
Buffer |
clone()
Gets a clone of the buffer. |
void |
close()
|
void |
decode(Filter filter,
PdfDictionary parameters)
Applies the specified filter to decode the buffer. |
void |
delete(int index,
int length)
Deletes a byte chunk from the buffer. |
byte[] |
encode(Filter filter,
PdfDictionary parameters)
Applies the specified filter to encode the buffer. |
protected void |
finalize()
|
int |
getByte(int index)
Gets the byte at a specified location. |
byte[] |
getByteArray(int index,
int length)
Gets the byte range beginning at a specified location. |
ByteOrder |
getByteOrder()
Gets the byte order. |
int |
getCapacity()
Gets the allocated buffer size. |
long |
getLength()
Gets the length of the stream. |
long |
getPosition()
Gets the pointer position. |
String |
getString(int index,
int length)
Gets the string beginning at a specified location. |
void |
insert(int index,
byte[] data)
Inserts a byte array into the buffer. |
void |
insert(int index,
byte[] data,
int offset,
int length)
Inserts a byte range into the buffer. |
void |
insert(int index,
IInputStream data)
Inserts an IInputStream into the buffer. |
void |
insert(int index,
String data)
Inserts a string into the buffer. |
boolean |
isDirty()
Gets whether this buffer has changed. |
void |
read(byte[] data)
Reads a sequence of bytes. |
void |
read(byte[] data,
int offset,
int length)
Reads a sequence of bytes. |
byte |
readByte()
Reads a byte. |
int |
readInt()
Reads an integer. |
int |
readInt(int length)
Reads a variable-length integer. |
String |
readLine()
Reads the next line of text. |
short |
readShort()
Reads a short integer. |
String |
readString(int length)
Reads a string. |
int |
readUnsignedByte()
Reads an unsigned byte integer. |
int |
readUnsignedShort()
Reads an unsigned short integer. |
boolean |
removeListener(IBuffer.IListener listener)
Removes the specified listener. |
void |
replace(int index,
byte[] data)
Replaces the buffer contents with a byte array. |
void |
replace(int index,
byte[] data,
int offset,
int length)
Replaces the buffer contents with a byte range. |
void |
replace(int index,
IInputStream data)
Replaces the buffer contents with an IInputStream. |
void |
replace(int index,
String data)
Replaces the buffer contents with a string. |
void |
seek(long position)
Sets the pointer absolute position. |
void |
setByteOrder(ByteOrder value)
Sets the byte order. |
void |
setDirty(boolean value)
|
void |
setLength(int value)
Sets the used buffer size. |
void |
setPosition(long value)
Sets the pointer position. |
void |
skip(long offset)
Sets the pointer relative position. |
byte[] |
toByteArray()
Gets the buffer data copied to a newly-allocated byte array. |
void |
write(byte[] data)
Writes a byte array into the stream. |
void |
write(byte[] data,
int offset,
int length)
Writes a byte range into the stream. |
void |
write(IInputStream data)
Writes an IInputStream into the stream. |
void |
write(String data)
Writes a string into the stream. |
void |
writeTo(IOutputStream stream)
Writes the buffer data to a stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.pdfclown.bytes.IInputStream |
---|
hashCode |
Constructor Detail |
---|
public Buffer()
public Buffer(int capacity)
public Buffer(BufferedReader dataStream)
public Buffer(InputStream dataStream)
public Buffer(byte[] data)
public Buffer(byte[] data, ByteOrder byteOrder)
Method Detail |
---|
public void addListener(IBuffer.IListener listener)
IBuffer
addListener
in interface IBuffer
listener
- Listener to add.public IBuffer append(byte data)
IBuffer
append
in interface IBuffer
data
- Byte to copy.
public IBuffer append(byte[] data)
IBuffer
append
in interface IBuffer
data
- Byte array to copy.
public IBuffer append(byte[] data, int offset, int length)
IBuffer
append
in interface IBuffer
data
- Byte array from which the byte range has to be copied.offset
- Location in the byte array at which copying begins.length
- Number of bytes to copy.
public IBuffer append(String data)
IBuffer
append
in interface IBuffer
data
- String to copy.
public IBuffer append(IInputStream data)
IBuffer
append
in interface IBuffer
data
- Source data to copy.
public Buffer clone()
IBuffer
clone
in interface IBuffer
clone
in class Object
public void decode(Filter filter, PdfDictionary parameters)
IBuffer
decode
in interface IBuffer
filter
- Filter to use for decoding the buffer.parameters
- Decoding parameters.public void delete(int index, int length)
IBuffer
delete
in interface IBuffer
index
- Location at which deletion has to begin.length
- Number of bytes to delete.public byte[] encode(Filter filter, PdfDictionary parameters)
IBuffer
encode
in interface IBuffer
filter
- Filter to use for encoding the buffer.parameters
- Encoding parameters.
public int getByte(int index)
IBuffer
getByte
in interface IBuffer
index
- A location in the buffer.
public byte[] getByteArray(int index, int length)
IBuffer
getByteArray
in interface IBuffer
index
- Location at which the byte range has to begin.length
- Number of bytes to copy.
public String getString(int index, int length)
IBuffer
getString
in interface IBuffer
index
- Location at which the string has to begin.length
- Number of bytes to convert.
public int getCapacity()
IBuffer
getCapacity
in interface IBuffer
public void insert(int index, byte[] data)
IBuffer
insert
in interface IBuffer
index
- Location at which the byte array has to be inserted.data
- Byte array to insert.public void insert(int index, byte[] data, int offset, int length)
IBuffer
insert
in interface IBuffer
index
- Location at which the byte range has to be inserted.data
- Byte array from which the byte range has to be copied.offset
- Location in the byte array at which copying begins.length
- Number of bytes to copy.public void insert(int index, String data)
IBuffer
insert
in interface IBuffer
index
- Location at which the string has to be inserted.data
- String to insert.public void insert(int index, IInputStream data)
IBuffer
insert
in interface IBuffer
index
- Location at which the IInputStream has to be inserted.data
- Source data to copy.public boolean removeListener(IBuffer.IListener listener)
IBuffer
removeListener
in interface IBuffer
listener
- Listener to remove.
public void replace(int index, byte[] data)
IBuffer
replace
in interface IBuffer
index
- Location at which the byte array has to be copied.data
- Byte array to copy.public void replace(int index, byte[] data, int offset, int length)
IBuffer
replace
in interface IBuffer
index
- Location at which the byte range has to be copied.data
- Byte array from which the byte range has to be copied.offset
- Location in the byte array at which copying begins.length
- Number of bytes to copy.public void replace(int index, String data)
IBuffer
replace
in interface IBuffer
index
- Location at which the string has to be copied.data
- String to copy.public void replace(int index, IInputStream data)
IBuffer
replace
in interface IBuffer
index
- Location at which the IInputStream has to be copied.data
- Source data to copy.public void setDirty(boolean value)
setDirty
in interface IBuffer
IBuffer.isDirty()
public void setLength(int value)
IBuffer
setLength
in interface IBuffer
value
- New length.public void writeTo(IOutputStream stream)
IBuffer
writeTo
in interface IBuffer
stream
- Target stream.public ByteOrder getByteOrder()
IInputStream
getByteOrder
in interface IInputStream
public long getPosition()
IInputStream
getPosition
in interface IInputStream
public boolean isDirty()
IBuffer
isDirty
in interface IBuffer
public void read(byte[] data)
IInputStream
This operation causes the stream pointer to advance after the read data.
read
in interface IInputStream
data
- Target byte array.public void read(byte[] data, int offset, int length)
IInputStream
This operation causes the stream pointer to advance after the read data.
read
in interface IInputStream
data
- Target byte array.offset
- Location in the byte array at which storing begins.length
- Number of bytes to read.public byte readByte() throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readByte
in interface IInputStream
EOFException
public int readInt() throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readInt
in interface IInputStream
EOFException
public int readInt(int length) throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readInt
in interface IInputStream
length
- Number of bytes to read.
EOFException
public String readLine() throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readLine
in interface IInputStream
EOFException
public short readShort() throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readShort
in interface IInputStream
EOFException
public String readString(int length)
IInputStream
This operation causes the stream pointer to advance after the read data.
readString
in interface IInputStream
length
- Number of bytes to read.public int readUnsignedByte() throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readUnsignedByte
in interface IInputStream
EOFException
public int readUnsignedShort() throws EOFException
IInputStream
This operation causes the stream pointer to advance after the read data.
readUnsignedShort
in interface IInputStream
EOFException
public void seek(long position)
IInputStream
seek
in interface IInputStream
public void setByteOrder(ByteOrder value)
IInputStream
setByteOrder
in interface IInputStream
public void setPosition(long value)
IInputStream
setPosition
in interface IInputStream
public void skip(long offset)
IInputStream
skip
in interface IInputStream
public byte[] toByteArray()
IDataWrapper
toByteArray
in interface IDataWrapper
public long getLength()
IStream
getLength
in interface IStream
public void close() throws IOException
close
in interface Closeable
IOException
public void write(byte[] data)
IOutputStream
write
in interface IOutputStream
data
- Byte array to write into the stream.public void write(byte[] data, int offset, int length)
IOutputStream
write
in interface IOutputStream
data
- Byte array to write into the stream.offset
- Location in the byte array at which writing begins.length
- Number of bytes to write.public void write(String data)
IOutputStream
write
in interface IOutputStream
data
- String to write into the stream.public void write(IInputStream data)
IOutputStream
IInputStream
into the stream.
write
in interface IOutputStream
data
- IInputStream to write into the stream.protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
PDF Clown 0.1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |