net.wimpi.modbus.io
Class BytesOutputStream
java.lang.Object
java.io.OutputStream
net.wimpi.modbus.io.FastByteArrayOutputStream
net.wimpi.modbus.io.BytesOutputStream
- All Implemented Interfaces:
- Closeable, DataOutput, Flushable
public class BytesOutputStream
- extends FastByteArrayOutputStream
- implements DataOutput
Class implementing a byte array output stream with
a DataInput interface.
- Version:
- @version@ (@date@)
- 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.wimpi.modbus.io.FastByteArrayOutputStream |
close, ensureCapacity, size, toByteArray, toByteArray, toString, toString, write, write, write, writeTo |
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 IOException
- Specified by:
writeBoolean
in interface DataOutput
- Throws:
IOException
writeByte
public void writeByte(int v)
throws IOException
- Specified by:
writeByte
in interface DataOutput
- Throws:
IOException
writeShort
public void writeShort(int v)
throws IOException
- Specified by:
writeShort
in interface DataOutput
- Throws:
IOException
writeChar
public void writeChar(int v)
throws IOException
- Specified by:
writeChar
in interface DataOutput
- Throws:
IOException
writeInt
public void writeInt(int v)
throws IOException
- Specified by:
writeInt
in interface DataOutput
- Throws:
IOException
writeLong
public void writeLong(long v)
throws IOException
- Specified by:
writeLong
in interface DataOutput
- Throws:
IOException
writeFloat
public void writeFloat(float v)
throws IOException
- Specified by:
writeFloat
in interface DataOutput
- Throws:
IOException
writeDouble
public void writeDouble(double v)
throws IOException
- Specified by:
writeDouble
in interface DataOutput
- Throws:
IOException
writeBytes
public void writeBytes(String s)
throws IOException
- Specified by:
writeBytes
in interface DataOutput
- Throws:
IOException
writeChars
public void writeChars(String s)
throws IOException
- Specified by:
writeChars
in interface DataOutput
- Throws:
IOException
writeUTF
public void writeUTF(String str)
throws IOException
- Specified by:
writeUTF
in interface DataOutput
- Throws:
IOException
Copyright © 2010. All Rights Reserved.