Package org.apache.xmlbeans.impl.util
Class LongUTFDataOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.apache.xmlbeans.impl.util.LongUTFDataOutputStream
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,AutoCloseable
public class LongUTFDataOutputStream extends DataOutputStream
This class works around the size limitation of UTF strings (< 64kb) of DataOutputStream
and needs to be used with LongUTFDataInputStream
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LongUTFDataOutputStream(OutputStream out)
-
Method Summary
Modifier and Type Method Description static int
countUTF(String str)
void
writeLongUTF(String str)
Checks the length of the to-be-written UTF-8 array, if the length is below 64k thenDataOutputStream.writeUTF(String)
is called, otherwise a 4-byte (int) is injected to list/count the appended UTF-8 bytesvoid
writeShortOrInt(int value)
static void
writeShortOrInt(DataOutputStream dos, int value)
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Constructor Details
-
Method Details
-
writeShortOrInt
- Throws:
IOException
-
writeShortOrInt
- Throws:
IOException
-
writeLongUTF
Checks the length of the to-be-written UTF-8 array, if the length is below 64k thenDataOutputStream.writeUTF(String)
is called, otherwise a 4-byte (int) is injected to list/count the appended UTF-8 bytes- Parameters:
str
- the string to be written as UTF8-modified- Throws:
IOException
-
countUTF
-