public class DataBufferedOutputStream
extends java.io.BufferedOutputStream
implements java.io.DataOutput
The implementation was largely copied from
nom.tam.util.BufferedDataOutputStream
.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE
Default buffer size 8192, same as java.io.BufferedOutputStream.
|
Constructor and Description |
---|
DataBufferedOutputStream(java.io.OutputStream out)
Constructs a stream with a default buffer size.
|
DataBufferedOutputStream(java.io.OutputStream out,
int size)
Constructs a stream with a given buffer size.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkBuf(int need)
Try to ensure there is a given number of bytes in the buffer.
|
void |
writeBoolean(boolean b) |
void |
writeByte(int b) |
void |
writeBytes(java.lang.String s) |
void |
writeChar(int v) |
void |
writeChars(java.lang.String s) |
void |
writeCharUTF8(char c)
Writes a single character in UTF8 format.
|
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 static final int DEFAULT_BUFFER_SIZE
public DataBufferedOutputStream(java.io.OutputStream out)
out
- base output streampublic DataBufferedOutputStream(java.io.OutputStream out, int size)
out
- base output streamsize
- buffer size in bytes, must be >=8public void writeBoolean(boolean b) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public void writeByte(int b) 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 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 writeChar(int v) throws java.io.IOException
writeChar
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 writeCharUTF8(char c) throws java.io.IOException
c
- character to writejava.io.IOException
protected void checkBuf(int need) throws java.io.IOException
need
- number of bytes requiredjava.io.IOException