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, count
out
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, write
close, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write, write, write
public 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 DataOutput
IOException
public void writeByte(int b) throws IOException
writeByte
in interface DataOutput
IOException
public void writeShort(int v) throws IOException
writeShort
in interface DataOutput
IOException
public void writeInt(int v) throws IOException
writeInt
in interface DataOutput
IOException
public void writeLong(long v) throws IOException
writeLong
in interface DataOutput
IOException
public void writeChar(int v) throws IOException
writeChar
in interface DataOutput
IOException
public void writeFloat(float v) throws IOException
writeFloat
in interface DataOutput
IOException
public void writeDouble(double v) throws IOException
writeDouble
in interface DataOutput
IOException
public void writeBytes(String s) throws IOException
writeBytes
in interface DataOutput
IOException
public void writeChars(String s) throws IOException
writeChars
in interface DataOutput
IOException
public void writeUTF(String s) throws IOException
writeUTF
in interface DataOutput
IOException
public void writeCharUTF8(char c) throws IOException
c
- character to writeIOException
protected void checkBuf(int need) throws IOException
need
- number of bytes requiredIOException
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.