Package org.apache.qpid.protonj2.buffer
Class ProtonBufferOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.qpid.protonj2.buffer.ProtonBufferOutputStream
-
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,AutoCloseable
public class ProtonBufferOutputStream extends OutputStream implements DataOutput
ProtonBufferspecializedOutputStreamimplementation which can be used to adapt the proton buffer types into code that uses the streams API.
-
-
Constructor Summary
Constructors Constructor Description ProtonBufferOutputStream(ProtonBuffer buffer)Create a newOutputStreamwhich wraps the given buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intgetBytesWritten()voidwrite(byte[] array)voidwrite(byte[] array, int offset, int length)voidwrite(int value)voidwriteBoolean(boolean value)voidwriteByte(int value)voidwriteBytes(String value)voidwriteChar(int value)voidwriteChars(String value)voidwriteDouble(double value)voidwriteFloat(float value)voidwriteInt(int value)voidwriteLong(long value)voidwriteShort(int value)voidwriteUTF(String value)-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
-
-
-
Constructor Detail
-
ProtonBufferOutputStream
public ProtonBufferOutputStream(ProtonBuffer buffer)
Create a newOutputStreamwhich wraps the given buffer.- Parameters:
buffer- The buffer that this stream will write to.
-
-
Method Detail
-
getBytesWritten
public int getBytesWritten()
- Returns:
- a running total of the number of bytes that has been written to this
OutputStream
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean value) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
write
public void write(int value) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] array, int offset, int length) throws IOException- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] array) throws IOException- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
writeByte
public void writeByte(int value) throws IOException- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
public void writeShort(int value) throws IOException- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
public void writeChar(int value) throws IOException- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
public void writeInt(int value) throws IOException- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
public void writeLong(long value) throws IOException- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
public void writeFloat(float value) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
public void writeDouble(double value) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(String value) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
public void writeChars(String value) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
public void writeUTF(String value) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
-