Package com.sshtools.j2ssh.io
Class ByteArrayWriter
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- com.sshtools.j2ssh.io.ByteArrayWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class ByteArrayWriter extends java.io.ByteArrayOutputStream
- Version:
- $Revision: 1.18 $
- Author:
- $author$
-
-
Constructor Summary
Constructors Constructor Description ByteArrayWriter()
Creates a new ByteArrayWriter object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]
encodeInt(int i)
void
writeBigInteger(java.math.BigInteger bi)
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(java.lang.String str)
void
writeUINT32(UnsignedInteger32 value)
void
writeUINT64(UnsignedInteger64 value)
-
-
-
Method Detail
-
writeBigInteger
public void writeBigInteger(java.math.BigInteger bi) throws java.io.IOException
- Parameters:
bi
-- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(boolean b) throws java.io.IOException
- Parameters:
b
-- Throws:
java.io.IOException
-
writeBinaryString
public void writeBinaryString(byte[] data) throws java.io.IOException
- Parameters:
data
-- Throws:
java.io.IOException
-
writeInt
public void writeInt(long i) throws java.io.IOException
- Parameters:
i
-- Throws:
java.io.IOException
-
writeInt
public void writeInt(int i) throws java.io.IOException
- Parameters:
i
-- Throws:
java.io.IOException
-
encodeInt
public static byte[] encodeInt(int i)
- Parameters:
i
-- Returns:
-
writeUINT32
public void writeUINT32(UnsignedInteger32 value) throws java.io.IOException
- Parameters:
value
-- Throws:
java.io.IOException
-
writeUINT64
public void writeUINT64(UnsignedInteger64 value) throws java.io.IOException
- Parameters:
value
-- Throws:
java.io.IOException
-
writeIntToArray
public static void writeIntToArray(byte[] array, int pos, int value) throws java.io.IOException
- Parameters:
array
-pos
-value
-- Throws:
java.io.IOException
-
writeString
public void writeString(java.lang.String str) throws java.io.IOException
- Parameters:
str
-- Throws:
java.io.IOException
-
-