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
This class works around the size limitation of UTF strings (< 64kb) of DataOutputStream
and needs to be used with LongUTFDataInputStream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
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
Methods inherited from class java.io.FilterOutputStream
close, write
Methods inherited from class java.io.OutputStream
nullOutputStream
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.io.DataOutput
write
-
Constructor Details
-
LongUTFDataOutputStream
-
-
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
-