Package pixy.io
Class EndianAwareOutputStream
java.lang.Object
java.io.OutputStream
pixy.io.EndianAwareOutputStream
- All Implemented Interfaces:
java.io.Closeable,java.io.DataOutput,java.io.Flushable,java.lang.AutoCloseable
public class EndianAwareOutputStream
extends java.io.OutputStream
implements java.io.DataOutput
Endian-aware OutputStream backed up by WriteStrategy
- Version:
- 1.0 02/03/2014
- Author:
- Wen Yu, yuwen_66@yahoo.com
-
Constructor Summary
Constructors Constructor Description EndianAwareOutputStream(java.io.OutputStream os) -
Method Summary
Modifier and Type Method Description voidclose()voidsetWriteStrategy(WriteStrategy strategy)voidwrite(int value)voidwriteBoolean(boolean value)voidwriteByte(int value)voidwriteBytes(java.lang.String value)voidwriteChar(int value)voidwriteChars(java.lang.String value)voidwriteDouble(double value)voidwriteFloat(float value)voidwriteInt(int value)voidwriteLong(long value)voidwriteS15Fixed16Number(float value)voidwriteShort(int value)voidwriteU16Fixed16Number(float value)voidwriteU8Fixed8Number(float value)voidwriteUTF(java.lang.String value)
-
Constructor Details
-
EndianAwareOutputStream
public EndianAwareOutputStream(java.io.OutputStream os)
-
-
Method Details
-
setWriteStrategy
-
write
public void write(int value) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(boolean value) throws java.io.IOException- Specified by:
writeBooleanin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeByte
public void writeByte(int value) throws java.io.IOException- Specified by:
writeBytein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(java.lang.String value) throws java.io.IOException- Specified by:
writeBytesin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeChar
public void writeChar(int value) throws java.io.IOException- Specified by:
writeCharin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeChars
public void writeChars(java.lang.String value) throws java.io.IOException- Specified by:
writeCharsin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double value) throws java.io.IOException- Specified by:
writeDoublein interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(float value) throws java.io.IOException- Specified by:
writeFloatin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeInt
public void writeInt(int value) throws java.io.IOException- Specified by:
writeIntin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeLong
public void writeLong(long value) throws java.io.IOException- Specified by:
writeLongin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeS15Fixed16Number
public void writeS15Fixed16Number(float value) throws java.io.IOException- Throws:
java.io.IOException
-
writeShort
public void writeShort(int value) throws java.io.IOException- Specified by:
writeShortin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
writeU16Fixed16Number
public void writeU16Fixed16Number(float value) throws java.io.IOException- Throws:
java.io.IOException
-
writeU8Fixed8Number
public void writeU8Fixed8Number(float value) throws java.io.IOException- Throws:
java.io.IOException
-
writeUTF
public void writeUTF(java.lang.String value) throws java.io.IOException- Specified by:
writeUTFin interfacejava.io.DataOutput- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-