|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.fostore.FOStoreOutput
Extend ByteArrayOutputStream so that we can get ahold of the byte array and current position, and can make sure we have enough space to write an object. We also allow getting and changing the current position. Also, implement DataOutput so that we can write easily to this output.
Nested Class Summary | |
(package private) class |
FOStoreOutput.LocalByteArrayOutputStream
|
Field Summary | |
private boolean |
closed
|
private java.io.DataOutputStream |
dos
|
private static I18NHelper |
msg
I18N support. |
private FOStoreOutput.LocalByteArrayOutputStream |
stream
|
Constructor Summary | |
(package private) |
FOStoreOutput()
|
Method Summary | |
private void |
assertNotClosed()
|
(package private) int |
beginStash()
Write a nonsense int value at the current position, and return that position for later use with endStash |
void |
close()
Close the stream. |
(package private) void |
endStash(int value,
int pos)
Write the given value at the given position, and reset the position to what it was before the write occurred. |
(package private) byte[] |
getBuf()
Provides no-copy access to the buffer. |
(package private) int |
getPos()
Provides the stream's current writing position. |
void |
reset()
Reset the stream. |
(package private) void |
setPos(int pos)
Allows for setting the current writing position. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
void |
writeBoolean(boolean v)
|
void |
writeByte(int v)
|
void |
writeBytes(java.lang.String s)
|
void |
writeChar(int v)
|
void |
writeChars(java.lang.String s)
|
void |
writeDouble(double v)
|
void |
writeFloat(float v)
|
void |
writeInt(int v)
|
void |
writeLong(long v)
|
void |
writeShort(int v)
|
void |
writeUTF(java.lang.String str)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean closed
private final FOStoreOutput.LocalByteArrayOutputStream stream
private final java.io.DataOutputStream dos
private static final I18NHelper msg
Constructor Detail |
FOStoreOutput()
Method Detail |
public void close()
public void reset()
byte[] getBuf()
int beginStash() throws java.io.IOException
java.io.IOException
endStash(int, int)
void endStash(int value, int pos) throws java.io.IOException
value
- Value to be writtenpos
- Position in this output at which value is to be written
java.io.IOException
beginStash()
int getPos()
void setPos(int pos) throws java.io.IOException
pos
- Position at which future write operations will take
place.
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(int b) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void writeBoolean(boolean v) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public void writeByte(int v) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public void writeChar(int v) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public void writeDouble(double v) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public void writeFloat(float v) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public void writeInt(int v) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public void writeLong(long v) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public void writeShort(int v) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public void writeUTF(java.lang.String str) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException
private void assertNotClosed()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |