Package com.sshtools.j2ssh.io
Class ByteArrayWriter
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.sshtools.j2ssh.io.ByteArrayWriter
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Version:
- $Revision: 1.18 $
- Author:
- $author$
-
Field Summary
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
encodeInt
(int i) void
void
writeBinaryString
(byte[] data) void
writeBoolean
(boolean b) void
writeInt
(int i) void
writeInt
(long i) static void
writeIntToArray
(byte[] array, int pos, int value) void
writeString
(String str) void
writeUINT32
(UnsignedInteger32 value) void
writeUINT64
(UnsignedInteger64 value) Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeTo
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
ByteArrayWriter
public ByteArrayWriter()Creates a new ByteArrayWriter object.
-
-
Method Details
-
writeBigInteger
- Parameters:
bi
-- Throws:
IOException
-
writeBoolean
- Parameters:
b
-- Throws:
IOException
-
writeBinaryString
- Parameters:
data
-- Throws:
IOException
-
writeInt
- Parameters:
i
-- Throws:
IOException
-
writeInt
- Parameters:
i
-- Throws:
IOException
-
encodeInt
public static byte[] encodeInt(int i) - Parameters:
i
-- Returns:
-
writeUINT32
- Parameters:
value
-- Throws:
IOException
-
writeUINT64
- Parameters:
value
-- Throws:
IOException
-
writeIntToArray
- Parameters:
array
-pos
-value
-- Throws:
IOException
-
writeString
- Parameters:
str
-- Throws:
IOException
-