Class BinaryOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.commons.imaging.common.BinaryOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class BinaryOutputStream extends OutputStream
-
-
Constructor Summary
Constructors Constructor Description BinaryOutputStream(OutputStream os)
BinaryOutputStream(OutputStream os, ByteOrder byteOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
int
getByteCount()
ByteOrder
getByteOrder()
protected void
setByteOrder(ByteOrder byteOrder)
void
write(byte[] bytes)
void
write(byte[] bytes, int offset, int length)
void
write(int i)
void
write2Bytes(int value)
void
write3Bytes(int value)
void
write4Bytes(int value)
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
BinaryOutputStream
public BinaryOutputStream(OutputStream os, ByteOrder byteOrder)
-
BinaryOutputStream
public BinaryOutputStream(OutputStream os)
-
-
Method Detail
-
setByteOrder
protected void setByteOrder(ByteOrder byteOrder)
-
getByteOrder
public ByteOrder getByteOrder()
-
write
public void write(int i) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public final void write(byte[] bytes) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public final void write(byte[] bytes, int offset, int length) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
getByteCount
public int getByteCount()
-
write4Bytes
public final void write4Bytes(int value) throws IOException
- Throws:
IOException
-
write3Bytes
public final void write3Bytes(int value) throws IOException
- Throws:
IOException
-
write2Bytes
public final void write2Bytes(int value) throws IOException
- Throws:
IOException
-
-