|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.tumba.parser.swf.OutStream
public class OutStream
Output Stream Wrapper
Field Summary | |
---|---|
protected int |
bitBuf
Description of the Field |
protected int |
bitPos
Description of the Field |
protected long |
bytesWritten
Description of the Field |
protected java.io.OutputStream |
out
Description of the Field |
Constructor Summary | |
---|---|
OutStream(java.io.OutputStream out)
Constructor for the OutStream object |
Method Summary | |
---|---|
void |
close()
Description of the Method |
static int |
determineSignedBitSize(int value)
Determine the minimum number of bits required to hold the given signed value |
static int |
determineUnsignedBitSize(long value)
Determine the minimum number of bits required to hold the given unsigned value (may be zero) |
void |
flush()
Description of the Method |
void |
flushBits()
Flush the bit buffer to the output stream and reset values |
static boolean |
getBit(int bitNum,
long value)
Get the given bit (where lowest bit is numbered 1) |
long |
getBytesWritten()
Gets the bytesWritten attribute of the OutStream object |
static int |
getStringLength(byte[] string)
Calculate the byte length of a string as it would be written to the output stream |
static int |
getStringLength(java.lang.String string)
Calculate the byte length of a string as it would be written to the output stream using the default character encoding |
protected void |
initBits()
Reset the bit buffer |
static int |
setBit(int bitNum,
int value)
Set the given bit (where lowest bit is numbered 1) |
void |
setBytesWritten(long written)
Sets the bytesWritten attribute of the OutStream object |
static byte[] |
sintTo2Bytes(int value)
Util to convert a signed int to 2 bytes |
static byte[] |
uintTo2Bytes(int value)
Util to convert an unsigned int to 2 bytes |
static byte[] |
uintTo4Bytes(int value)
Util to convert an unsigned int to 4 bytes |
static byte |
uintToByte(int value2)
Util to convert an unsigned int to an unsigned byte |
void |
write(byte[] bytes)
Write the given bytes to the output stream |
void |
write(byte[] bytes,
int start,
int length)
Write the given bytes to the output stream |
void |
writeDouble(double value)
Write a double value |
void |
writeFloat(float value)
Write a float value |
void |
writeSBits(int numBits,
int value)
Write a signed value to the output stream in the given number of bits. |
void |
writeSI16(short value)
Write a 16 bit signed value to the out stream |
void |
writeSI32(int value)
Write a 32 bit signed value |
void |
writeString(byte[] string)
Write a string to the output stream and add terminating null |
void |
writeString(java.lang.String s2)
Write a string to the output stream using the default encoding and add terminating null |
void |
writeUBits(int numBits,
long value)
Write an unsigned value to the output stream in the given number of bits |
void |
writeUI16(int value)
Write a 16 bit unsigned value to the out stream |
void |
writeUI32(long value)
Write a 32 bit unsigned value to the out stream |
void |
writeUI8(int value)
Write an 8 bit unsigned value to the out stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.OutputStream out
protected long bytesWritten
protected int bitBuf
protected int bitPos
Constructor Detail |
---|
public OutStream(java.io.OutputStream out)
out
- Description of the ParameterMethod Detail |
---|
public long getBytesWritten()
public void setBytesWritten(long written)
written
- The new bytesWritten valuepublic void writeSBits(int numBits, int value) throws java.io.IOException
numBits
- Description of the Parametervalue
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void flush() throws java.io.IOException
java.io.IOException
- Description of the Exceptionpublic void close() throws java.io.IOException
java.io.IOException
- Description of the Exceptionpublic void flushBits() throws java.io.IOException
java.io.IOException
- Description of the Exceptionpublic void writeUBits(int numBits, long value) throws java.io.IOException
numBits
- Description of the Parametervalue
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic static boolean getBit(int bitNum, long value)
bitNum
- Description of the Parametervalue
- Description of the Parameter
public static int setBit(int bitNum, int value)
bitNum
- The new bit valuevalue
- The new bit value
public void write(byte[] bytes) throws java.io.IOException
bytes
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void write(byte[] bytes, int start, int length) throws java.io.IOException
bytes
- Description of the Parameterstart
- Description of the Parameterlength
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeUI8(int value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeUI16(int value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeSI16(short value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeUI32(long value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeString(java.lang.String s2) throws java.io.IOException
s
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeString(byte[] string) throws java.io.IOException
string
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic static int getStringLength(byte[] string)
string
- Description of the Parameter
public static int getStringLength(java.lang.String string)
string
- Description of the Parameter
protected void initBits()
public static int determineSignedBitSize(int value)
value
- Description of the Parameter
public static int determineUnsignedBitSize(long value)
value
- Description of the Parameter
public void writeFloat(float value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeDouble(double value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void writeSI32(int value) throws java.io.IOException
value
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic static byte[] sintTo2Bytes(int value)
value
- Description of the Parameter
public static byte[] uintTo2Bytes(int value)
value
- Description of the Parameter
public static byte[] uintTo4Bytes(int value)
value
- Description of the Parameter
public static byte uintToByte(int value2)
value
- Description of the Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |