public class OutputStream<T extends OutputStream> extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closeStream |
protected long |
currentPos |
protected OutputStream |
outputStream |
| Modifier | Constructor and Description |
|---|---|
protected |
OutputStream()
Do not use this constructor.
|
|
OutputStream(OutputStream outputStream)
Creates a new
OutputStream instance
based on OutputStream instance. |
|
OutputStream(OutputStream outputStream,
boolean localHighPrecision)
Creates a new
OutputStream instance
based on OutputStream instance and precision setting value. |
| Modifier and Type | Method and Description |
|---|---|
void |
assignBytes(byte[] bytes,
int count)
|
void |
close() |
void |
flush() |
long |
getCurrentPos()
Gets current output stream position.
|
static boolean |
getHighPrecision()
Gets global high precision setting.
|
boolean |
getLocalHighPrecision()
Gets local high precision setting.
|
OutputStream |
getOutputStream()
Gets internal
OutputStream. |
boolean |
isCloseStream()
Returns true, if internal
OutputStream have to be closed after close() call,
false otherwise. |
void |
reset()
|
void |
setCloseStream(boolean closeStream)
Sets internal
OutputStream to be closed after close(). |
static void |
setHighPrecision(boolean value)
Sets global high precision setting for all
OutputStream instances. |
void |
setLocalHighPrecision(boolean value)
Sets local high precision setting for the
OutputStream. |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeByte(byte value)
|
T |
writeByte(int value)
Writes byte to internal
OutputStream. |
T |
writeBytes(byte[] b)
See
write(byte[]). |
T |
writeBytes(byte[] b,
int off,
int len)
|
T |
writeDouble(double value)
Writes double to internal
OutputStream in ISO format. |
T |
writeDouble(double value,
boolean highPrecision)
Writes double to internal
OutputStream in ISO format. |
T |
writeFloat(float value)
Writes float to internal
OutputStream in ISO format. |
T |
writeFloat(float value,
boolean highPrecision)
Writes float to internal
OutputStream in ISO format. |
T |
writeFloats(float[] value)
Writes float array to internal
OutputStream in ISO format. |
T |
writeInteger(int value)
Writes int to internal
OutputStream in ISO format. |
T |
writeLong(long value)
Writes long to internal
OutputStream in ISO format. |
T |
writeNewLine()
Writes new line to internal
OutputStream. |
T |
writeSpace()
Writes space to internal
OutputStream. |
T |
writeString(String value)
Writes
String to internal OutputStream in ISO format. |
protected OutputStream outputStream
protected long currentPos
protected boolean closeStream
public OutputStream(OutputStream outputStream)
OutputStream instance
based on OutputStream instance.outputStream - the OutputStream instance.protected OutputStream()
public OutputStream(OutputStream outputStream, boolean localHighPrecision)
OutputStream instance
based on OutputStream instance and precision setting value.outputStream - the OutputStream instance.localHighPrecision - If true, all float and double values
will be written with high precision.
Global ByteUtils.HighPrecision setting
will be overridden by this one.public static boolean getHighPrecision()
public static void setHighPrecision(boolean value)
OutputStream instances.value - if true, all floats and double will be written with high precision
in all OutputStream instances.public boolean getLocalHighPrecision()
public void setLocalHighPrecision(boolean value)
OutputStream.
Global ByteUtils.HighPrecision setting will be overridden by this one.value - if true, all floats and double will be written with high precision
in the underlying OutputStream.public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void writeByte(byte value)
value - byte to write.IOException - if IOException occurs.public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic T writeLong(long value)
OutputStream in ISO format.value - value to write.public T writeInteger(int value)
OutputStream in ISO format.value - value to write.public T writeFloat(float value)
OutputStream in ISO format.value - value to write.public T writeFloat(float value, boolean highPrecision)
OutputStream in ISO format.value - value to write.highPrecision - If true, float value will be written with high precision.public T writeFloats(float[] value)
OutputStream in ISO format.value - float array to write.public T writeDouble(double value)
OutputStream in ISO format.value - value to write.public T writeDouble(double value, boolean highPrecision)
OutputStream in ISO format.value - value to write.highPrecision - If true, double value will be written with high precision.public T writeByte(int value)
OutputStream.value - value to write.public T writeSpace()
OutputStream.public T writeNewLine()
OutputStream.public T writeString(String value)
String to internal OutputStream in ISO format.value - string to write.public T writeBytes(byte[] b)
write(byte[]).b - byte array to write.IOException - if IOException is thrown.public T writeBytes(byte[] b, int off, int len)
b - the data to write.off - the start offset in the data.len - the number of bytes to write.IOException - if IOException is thrown.public long getCurrentPos()
public OutputStream getOutputStream()
OutputStream.OutputStream.public boolean isCloseStream()
OutputStream have to be closed after close() call,
false otherwise.public void setCloseStream(boolean closeStream)
OutputStream to be closed after close().closeStream - true if stream needs to be closed, false if it's done manually.public void assignBytes(byte[] bytes,
int count)
bytes - bytes to assign.count - number of bytes to assign.public void reset()
IOException - if internal OutputStream.
is not a ByteArrayOutputStream instance.Copyright © 1998–2024 Apryse Group NV. All rights reserved.