Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public class CompressedDataOutputStream extends DataOutputStream
CompressedDataInputStreamwrittenout| Constructor and Description |
|---|
CompressedDataOutputStream(OutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
void |
writeCompressedInt(int i) |
static void |
writeCompressedInt(int i,
OutputStream out) |
void |
writeCompressedUTF(String str) |
void |
writeCompressedUTF(String str,
int slot)
Writes a String to the stream while using prefix compression.
|
void |
writeLongUTF(String str)
Writes a string of any length.
|
void |
writeNullEnum(Enum<?> e) |
void |
writeNullInteger(Integer i) |
void |
writeNullLong(Long l) |
void |
writeNullLongUTF(String str)
Writes a string of any length, supporting
null. |
void |
writeNullUTF(String str) |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFclose, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwritepublic CompressedDataOutputStream(OutputStream out)
public static void writeCompressedInt(int i,
OutputStream out)
throws IOException
IOExceptionCompressedDataInputStream.readCompressedInt()public void writeCompressedInt(int i)
throws IOException
IOExceptionpublic void writeCompressedUTF(String str) throws IOException
IOExceptionpublic void writeCompressedUTF(String str, int slot) throws IOException
The first byte has these bits:
X X X X X X X X
| | +-+-+-+-+-+ Slot number (0-63)
| +------------ 1 = Suffix UTF follows, 0 = No suffix UTF exists
+-------------- 1 = Common length difference follows, 0 = Common length not changed
Second, if common length difference is not zero, the common length change follows
one less for positive differences because 0 is handled in first byte
Third, if suffix UTF follows, writeUTF of all the string after common length
IOExceptionpublic void writeNullUTF(String str) throws IOException
IOExceptionpublic void writeLongUTF(String str) throws IOException
IOExceptionpublic void writeNullLongUTF(String str) throws IOException
null.IOExceptionpublic void writeNullInteger(Integer i) throws IOException
IOExceptionpublic void writeNullEnum(Enum<?> e) throws IOException
IOExceptionpublic void writeNullLong(Long l) throws IOException
IOExceptionCopyright © 2000–2016 AO Industries, Inc.. All rights reserved.