net.coalevo.empp.io
Class BytesOutputStream
java.lang.Object
java.io.OutputStream
net.coalevo.empp.io.FastByteArrayOutputStream
net.coalevo.empp.io.BytesOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.DataOutput, java.io.Flushable
public class BytesOutputStream
- extends FastByteArrayOutputStream
- implements java.io.DataOutput
Class implementing a byte array output stream with
a DataInput interface.
- Version:
- 0.0.1 (31/01/2009)
- Author:
- Dieter Wimberger
|
Constructor Summary |
BytesOutputStream(byte[] buffer)
Constructs a new BytesOutputStream instance with
a given output buffer. |
BytesOutputStream(int size)
Constructs a new BytesOutputStream instance with
a new output buffer of the given size. |
| Methods inherited from class net.coalevo.empp.io.FastByteArrayOutputStream |
close, ensureCapacity, size, toByteArray, toByteArray, toString, toString, write, write, write, writeTo |
| Methods inherited from class java.io.OutputStream |
flush |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.io.DataOutput |
write, write, write |
BytesOutputStream
public BytesOutputStream(int size)
- Constructs a new BytesOutputStream instance with
a new output buffer of the given size.
- Parameters:
size - the size of the output buffer as int.
BytesOutputStream
public BytesOutputStream(byte[] buffer)
- Constructs a new BytesOutputStream instance with
a given output buffer.
- Parameters:
buffer - the output buffer as byte[].
getBuffer
public byte[] getBuffer()
- Returns the reference to the output buffer.
- Overrides:
getBuffer in class FastByteArrayOutputStream
- Returns:
- the reference to the byte[] output buffer.
reset
public void reset()
- Description copied from class:
FastByteArrayOutputStream
- Resets the count of this FastByteArrayOutputStream
to zero, so that all currently accumulated output in the
ouput stream is discarded when overwritten.
- Overrides:
reset in class FastByteArrayOutputStream
writeBoolean
public void writeBoolean(boolean v)
throws java.io.IOException
- Specified by:
writeBoolean in interface java.io.DataOutput
- Throws:
java.io.IOException
writeByte
public void writeByte(int v)
throws java.io.IOException
- Specified by:
writeByte in interface java.io.DataOutput
- Throws:
java.io.IOException
writeShort
public void writeShort(int v)
throws java.io.IOException
- Specified by:
writeShort in interface java.io.DataOutput
- Throws:
java.io.IOException
writeChar
public void writeChar(int v)
throws java.io.IOException
- Specified by:
writeChar in interface java.io.DataOutput
- Throws:
java.io.IOException
writeInt
public void writeInt(int v)
throws java.io.IOException
- Specified by:
writeInt in interface java.io.DataOutput
- Throws:
java.io.IOException
writeLong
public void writeLong(long v)
throws java.io.IOException
- Specified by:
writeLong in interface java.io.DataOutput
- Throws:
java.io.IOException
writeFloat
public void writeFloat(float v)
throws java.io.IOException
- Specified by:
writeFloat in interface java.io.DataOutput
- Throws:
java.io.IOException
writeDouble
public void writeDouble(double v)
throws java.io.IOException
- Specified by:
writeDouble in interface java.io.DataOutput
- Throws:
java.io.IOException
writeBytes
public void writeBytes(java.lang.String s)
throws java.io.IOException
- Specified by:
writeBytes in interface java.io.DataOutput
- Throws:
java.io.IOException
writeChars
public void writeChars(java.lang.String s)
throws java.io.IOException
- Specified by:
writeChars in interface java.io.DataOutput
- Throws:
java.io.IOException
writeUTF
public void writeUTF(java.lang.String str)
throws java.io.IOException
- Specified by:
writeUTF in interface java.io.DataOutput
- Throws:
java.io.IOException
(c) 2004-2009 VFI (http://www.vfi.or.at)