DataOutput which wraps a ByteOutput. This implementation maintains
an internal buffer.
| Modifier and Type | Field and Description |
|---|---|
| protected byte[] | buffer
The internal buffer. |
| protected final int | bufferSize
The size of the internal buffer. |
| private int | position
The position in the buffer. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SimpleDataOutput(final int
the buffer size bufferSize, final ByteOutput the byte output to wrap byteOutput)Construct a new instance. |
| public | SimpleDataOutput(final ByteOutput
the byte output to wrap byteOutput)Construct a new instance with a default buffer size. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements java. |
| protected void | |
| public void | flush()
Overrides org. Implements java. |
| private static NotActiveException | |
| protected void | shallowFlush()
This shallow flush will write the internal buffer out to the |
| protected void | |
| public void | write(final int
the byte to be written. v)Overrides org. Implements java. b.
|
| public void | write(final byte[]
the data. bytes)Overrides org. Implements java. b.
|
| public void | write(final byte[]
the data. bytes, final int the start offset in the data. off, int the number of bytes to write. len)Overrides org. Implements java. len bytes from array
b, in order, to
the output stream.
|
| public void | writeBoolean(final boolean
the boolean to be written. v)Implements java. boolean value to this output stream.
|
| public void | writeByte(final int
the byte value to be written. v)Implements java. v.
|
| public void | writeBytes(final String
the string of bytes to be written. s)Implements java. |
| public void | writeChar(final int
the v)char value to be written.Implements java. char value, which
is comprised of two bytes, to the
output stream.
|
| public void | writeChars(final String
the string value to be written. s)Implements java. s,
to the output stream, in order,
two bytes per character.
|
| public void | writeDouble(final double
the v)double value to be written.Implements java. double value,
which is comprised of eight bytes, to the output stream.
|
| public void | writeFloat(final float
the v)float value to be written.Implements java. float value,
which is comprised of four bytes, to the output stream.
|
| public void | writeInt(final int
the v)int value to be written.Implements java. int value, which is
comprised of four bytes, to the output stream.
|
| public void | writeLong(final long
the v)long value to be written.Implements java. long value, which is
comprised of eight bytes, to the output stream.
|
| public void | writeShort(final int
the v)short value to be written.Implements java. |
| public void | writeUTF(final String
the string value to be written. s)Implements java. s.
|
| buffer | back to summary |
|---|---|
| protected byte[] buffer The internal buffer. | |
| bufferSize | back to summary |
|---|---|
| protected final int bufferSize The size of the internal buffer. | |
| position | back to summary |
|---|---|
| private int position The position in the buffer. | |
| SimpleDataOutput | back to summary |
|---|---|
| public SimpleDataOutput(final int bufferSize) Construct a new instance.
| |
| SimpleDataOutput | back to summary |
|---|---|
| public SimpleDataOutput(final int bufferSize, final ByteOutput byteOutput) Construct a new instance.
| |
| SimpleDataOutput | back to summary |
|---|---|
| public SimpleDataOutput(final ByteOutput byteOutput) Construct a new instance with a default buffer size.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides org. Implements java. Doc from org. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| finish | back to summary |
|---|---|
| protected void finish() throws IOException Finish writing to a stream. The stream is released.
No further writing may be done until the
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides org. Implements java. Doc from org. Flushes this stream by writing any buffered output to the underlying stream.
| |
| notActiveException | back to summary |
|---|---|
| private static NotActiveException notActiveException() | |
| shallowFlush | back to summary |
|---|---|
| protected void shallowFlush() throws IOException This shallow flush will write the internal buffer out to the
| |
| start | back to summary |
|---|---|
| protected void start(ByteOutput byteOutput) throws IOException Begin writing to a stream.
| |
| write | back to summary |
|---|---|
| public void write(final int v) throws IOException Overrides org. Implements java. Doc from java. Writes to the output stream the eight
low-order bits of the argument
| |
| write | back to summary |
|---|---|
| public void write(final byte[] bytes) throws IOException Overrides org. Implements java. Doc from java. Writes to the output stream all the bytes in array
| |
| write | back to summary |
|---|---|
| public void write(final byte[] bytes, final int off, int len) throws IOException Overrides org. Implements java. Doc from java. Writes
| |
| writeBoolean | back to summary |
|---|---|
| public void writeBoolean(final boolean v) throws IOException Implements java. Doc from java. Writes a
| |
| writeByte | back to summary |
|---|---|
| public void writeByte(final int v) throws IOException Implements java. Doc from java. Writes to the output stream the eight low-order
bits of the argument
| |
| writeBytes | back to summary |
|---|---|
| public void writeBytes(final String s) throws IOException Implements java. Doc from java. Writes a string to the output stream.
For every character in the string
If
| |
| writeChar | back to summary |
|---|---|
| public void writeChar(final int v) throws IOException Implements java. Doc from java. Writes a
The bytes written by this method may be
read by the
| |
| writeChars | back to summary |
|---|---|
| public void writeChars(final String s) throws IOException Implements java. Doc from java. Writes every character in the string
| |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(final double v) throws IOException Implements java. Doc from java. Writes a
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(final float v) throws IOException Implements java. Doc from java. Writes a
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(final int v) throws IOException Implements java. Doc from java. Writes an
The bytes written by this method may be read
by the
| |
| writeLong | back to summary |
|---|---|
| public void writeLong(final long v) throws IOException Implements java. Doc from java. Writes a
The bytes written by this method may be
read by the
| |
| writeShort | back to summary |
|---|---|
| public void writeShort(final int v) throws IOException Implements java. Doc from java. Writes two bytes to the output stream to represent the value of the argument. The byte values to be written, in the order shown, are:
The bytes written by this method may be
read by the
| |
| writeUTF | back to summary |
|---|---|
| public void writeUTF(final String s) throws IOException Implements java. Doc from java. Writes two bytes of length information
to the output stream, followed
by the
modified UTF-8
representation
of every character in the string
If a character (byte)c
If a character If a character
First,
the total number of bytes needed to represent
all the characters of The
bytes written by this method may be read
by the
| |