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
ProtonBuffer specialized OutputStream implementation which can be used to adapt
 the proton buffer types into code that uses the streams API. This stream wrapper does not take
 ownership of the provided buffer and will not close it upon a call to close()
 This stream is not thread-safe and should not be used by more than one thread at the same time.
- 
Constructor SummaryConstructorsConstructorDescriptionProtonBufferOutputStream(ProtonBuffer buffer) Create a newOutputStreamwhich wraps the given buffer.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()intvoidwrite(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) voidMethods inherited from class java.io.OutputStreamflush, nullOutputStream
- 
Constructor Details- 
ProtonBufferOutputStreamCreate a newOutputStreamwhich wraps the given buffer.- Parameters:
- buffer- The buffer that this stream will write to.
 
 
- 
- 
Method Details- 
getBytesWrittenpublic int getBytesWritten()- Returns:
- a running total of the number of bytes that has been written to this OutputStream
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- OutputStream
- Throws:
- IOException
 
- 
writeBoolean- Specified by:
- writeBooleanin interface- DataOutput
- Throws:
- IOException
 
- 
write- Specified by:
- writein interface- DataOutput
- Specified by:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Specified by:
- writein interface- DataOutput
- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Specified by:
- writein interface- DataOutput
- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
writeByte- Specified by:
- writeBytein interface- DataOutput
- Throws:
- IOException
 
- 
writeShort- Specified by:
- writeShortin interface- DataOutput
- Throws:
- IOException
 
- 
writeChar- Specified by:
- writeCharin interface- DataOutput
- Throws:
- IOException
 
- 
writeInt- Specified by:
- writeIntin interface- DataOutput
- Throws:
- IOException
 
- 
writeLong- Specified by:
- writeLongin interface- DataOutput
- Throws:
- IOException
 
- 
writeFloat- Specified by:
- writeFloatin interface- DataOutput
- Throws:
- IOException
 
- 
writeDouble- Specified by:
- writeDoublein interface- DataOutput
- Throws:
- IOException
 
- 
writeBytes- Specified by:
- writeBytesin interface- DataOutput
- Throws:
- IOException
 
- 
writeChars- Specified by:
- writeCharsin interface- DataOutput
- Throws:
- IOException
 
- 
writeUTF- Specified by:
- writeUTFin interface- DataOutput
- Throws:
- IOException
 
 
-