public class SimpleDataOutput extends ByteOutputStream implements java.io.DataOutput
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buffer |
protected int |
bufferSize |
byteOutput
Constructor and Description |
---|
SimpleDataOutput(ByteOutput byteOutput) |
SimpleDataOutput(int bufferSize) |
SimpleDataOutput(int bufferSize,
ByteOutput byteOutput) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finish()
Finish writing to a stream.
|
void |
flush() |
protected void |
shallowFlush()
This shallow flush will write the internal buffer out to the
ByteOutput , but will not flush it. |
protected void |
start(ByteOutput byteOutput)
Begin writing to a stream.
|
void |
write(byte[] bytes)
Write all the bytes from the given array to the stream.
|
void |
write(byte[] bytes,
int off,
int len)
Write some of the bytes from the given array to the stream.
|
void |
write(int v)
Writes to the output stream the eight low-order bits of the argument
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 s) |
public SimpleDataOutput(int bufferSize)
public SimpleDataOutput(int bufferSize, ByteOutput byteOutput)
public SimpleDataOutput(ByteOutput byteOutput)
public void write(int v) throws java.io.IOException
b
. The 24 high-order bits of
b
are ignored.write
in interface java.io.DataOutput
write
in interface ByteOutput
write
in class ByteOutputStream
v
- the byte to writejava.io.IOException
- if an error occurspublic void write(byte[] bytes) throws java.io.IOException
write
in interface java.io.DataOutput
write
in interface ByteOutput
write
in class ByteOutputStream
bytes
- the byte arrayjava.io.IOException
- if an error occurspublic void write(byte[] bytes, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
write
in interface ByteOutput
write
in class ByteOutputStream
bytes
- the byte arrayoff
- the index to start writing fromlen
- the number of bytes to writejava.io.IOException
- if an error occurspublic 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 writeShort(int v) throws java.io.IOException
writeShort
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 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 writeFloat(float v) throws java.io.IOException
writeFloat
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 writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
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 writeUTF(java.lang.String s) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class ByteOutputStream
java.io.IOException
protected void shallowFlush() throws java.io.IOException
ByteOutput
, but will not flush it.java.io.IOException
- if an I/O error occursprotected void start(ByteOutput byteOutput) throws java.io.IOException
byteOutput
- the new streamjava.io.IOException
- if an error occursprotected void finish() throws java.io.IOException
start(ByteOutput)
method is again invoked.java.io.IOException
- if an error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class ByteOutputStream
java.io.IOException
Copyright © 2011 JBoss, a division of Red Hat, Inc.