|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.pixie.wmf.Buffer
A block of raw mmeory. This is used to store various metafile objects as they are read in from file.
Field Summary | |
protected byte[] |
bytes
The memory itself. |
Constructor Summary | |
protected |
Buffer()
Default Constructor. |
protected |
Buffer(int length)
Defines a new buffer with the given initial size in bytes. |
Method Summary | |
int |
getByte(int offset)
Return the 8-bit int at the given byte offset. |
java.io.InputStream |
getInputStream(int offset)
Gets an input stream to read from the memory buffer. |
int |
getInt(int offset)
Return the 32-bit int at the given byte offset. |
int |
getLength()
The size of the stored data in the memory. |
int |
getShort(int offset)
Return the 16-bit int at the given byte offset. |
java.lang.String |
getString(int offset,
int len)
Return the null-terminated string at the given byte offset with the given maximum length. |
void |
read(java.io.InputStream in,
int offset,
int len)
Read len bytes into the memory from a stream and stores
the read bytes at the given offset. |
void |
setByte(int offset,
int value)
Sets the byte at the given offset. |
protected void |
setCapacity(int capacity)
Ensures that the buffer has enough space for the given number of bytes. |
void |
setInt(int offset,
int value)
Set the int value as big-endian. |
protected void |
setLength(int len)
Extends the length to the given new size. |
void |
setShort(int offset,
int shortval)
Stores the given short as BigEndian value. |
void |
setString(int offset,
java.lang.String str)
Writes the given string as byte stream using the plattforms default encoding. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected byte[] bytes
Constructor Detail |
protected Buffer()
protected Buffer(int length)
length
- the length of the buffer in bytes.Method Detail |
public final int getLength()
protected void setLength(int len)
len
- the new length.
java.lang.IllegalArgumentException
- if the length is shorter than the used
storage in memory.protected void setCapacity(int capacity)
capacity
- the new capacity that should be ensured.
java.lang.IllegalArgumentException
- if the capacity is smaller than the buffers length.public void read(java.io.InputStream in, int offset, int len) throws java.io.IOException
len
bytes into the memory from a stream and stores
the read bytes at the given offset.
in
- the input stream that should be usedoffset
- the offsetlen
- the number bytes that should be read.
java.io.IOException
public void setInt(int offset, int value)
offset
- the offset where to set the int value.value
- the integer value that should be set.public int getInt(int offset)
offset
- the offset where the integer value is stored in the memory
public void setShort(int offset, int shortval)
offset
- the offset.shortval
- the shortvalue.public int getShort(int offset)
offset
- the offset from where to read the short.
public void setByte(int offset, int value)
offset
- the offset.value
- the byte that should be set.public int getByte(int offset)
offset
- the offset from where to read the byte
public void setString(int offset, java.lang.String str)
offset
- the offset, where to store the string.str
- the string that should be stored in the Wmf.public java.lang.String getString(int offset, int len)
offset
- the offset where the string startslen
- the maximum length of the string
public java.io.InputStream getInputStream(int offset)
offset
- the offse, from where to read.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |