public class DataBufferedOutputStream extends BufferedOutputStream implements 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.
|
buf, countout| Constructor and Description |
|---|
DataBufferedOutputStream(OutputStream out)
Constructs a stream with a default buffer size.
|
DataBufferedOutputStream(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(String s) |
void |
writeChar(int v) |
void |
writeChars(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(String s) |
flush, write, writeclose, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writepublic static final int DEFAULT_BUFFER_SIZE
public DataBufferedOutputStream(OutputStream out)
out - base output streampublic DataBufferedOutputStream(OutputStream out, int size)
out - base output streamsize - buffer size in bytes, must be >=8public void writeBoolean(boolean b)
throws IOException
writeBoolean in interface DataOutputIOExceptionpublic void writeByte(int b)
throws IOException
writeByte in interface DataOutputIOExceptionpublic void writeShort(int v)
throws IOException
writeShort in interface DataOutputIOExceptionpublic void writeInt(int v)
throws IOException
writeInt in interface DataOutputIOExceptionpublic void writeLong(long v)
throws IOException
writeLong in interface DataOutputIOExceptionpublic void writeChar(int v)
throws IOException
writeChar in interface DataOutputIOExceptionpublic void writeFloat(float v)
throws IOException
writeFloat in interface DataOutputIOExceptionpublic void writeDouble(double v)
throws IOException
writeDouble in interface DataOutputIOExceptionpublic void writeBytes(String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic void writeChars(String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic void writeUTF(String s) throws IOException
writeUTF in interface DataOutputIOExceptionpublic void writeCharUTF8(char c)
throws IOException
c - character to writeIOExceptionprotected void checkBuf(int need)
throws IOException
need - number of bytes requiredIOExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.