OutputStream which writes data to a Buffer.
A write operation against this stream will occur at the writerOffset
of its underlying buffer and the writerOffset will increase during
the write operation.
This stream implements DataOutput for your convenience.
The endianness of the stream is always big endian.
BufferInputStream
| Modifier and Type | Field and Description |
|---|---|
| private final Buffer | |
| private boolean | |
| private final int | |
| private DataOutputStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Buffer | |
| public void | close()
Overrides java. Implements java. |
| private void | |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Implements java. len bytes from array
b, in order, to
the output stream.
|
| public void | write(byte[]
the data. b)Overrides java. Implements java. b.
|
| public void | write(int
the byte to be written. b)Implements abstract java. Implements java. b.
|
| public void | writeBoolean(boolean
the boolean to be written. v)Implements java. boolean value to this output stream.
|
| public void | writeByte(int
the byte value to be written. v)Implements java. v.
|
| public void | writeBytes(String
the string of bytes to be written. s)Implements java. |
| public void | writeChar(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(String
the string value to be written. s)Implements java. s,
to the output stream, in order,
two bytes per character.
|
| public void | writeDouble(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(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(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(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(int
the v)short value to be written.Implements java. |
| public void | writeUTF(String
the string value to be written. s)Implements java. s.
|
| public int |
| buffer | back to summary |
|---|---|
| private final Buffer buffer | |
| closed | back to summary |
|---|---|
| private boolean closed | |
| startIndex | back to summary |
|---|---|
| private final int startIndex | |
| utf8out | back to summary |
|---|---|
| private DataOutputStream utf8out | |
| BufferOutputStream | back to summary |
|---|---|
| public BufferOutputStream(Buffer buffer) Creates a new stream which writes data to the specified | |
| buffer | back to summary |
|---|---|
| public Buffer buffer() Returns the buffer where this stream is writing data. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| prepareWrite | back to summary |
|---|---|
| private void prepareWrite(int len) throws IOException | |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Implements java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Overrides java. Implements java. Doc from java. Writes to the output stream all the bytes in array
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Implements java. Doc from java. Writes to the output stream the eight
low-order bits of the argument
| |
| writeBoolean | back to summary |
|---|---|
| public void writeBoolean(boolean v) throws IOException Implements java. Doc from java. Writes a
| |
| writeByte | back to summary |
|---|---|
| public void writeByte(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(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(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(String s) throws IOException Implements java. Doc from java. Writes every character in the string
| |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(double v) throws IOException Implements java. Doc from java. Writes a
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float v) throws IOException Implements java. Doc from java. Writes a
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(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(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(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(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
| |
| writtenBytes | back to summary |
|---|---|
| public int writtenBytes() Returns the number of written bytes by this stream so far. | |