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:
java.io.Closeable
,java.io.DataOutput
,java.io.Flushable
,java.lang.AutoCloseable
public class LongUTFDataOutputStream extends java.io.DataOutputStream
This class works around the size limitation of UTF strings (< 64kb) of DataOutputStream and needs to be used with LongUTFDataInputStream
-
-
Constructor Summary
Constructors Constructor Description LongUTFDataOutputStream(java.io.OutputStream out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
countUTF(java.lang.String str)
void
writeLongUTF(java.lang.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(java.io.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
-
-
-
-
Method Detail
-
writeShortOrInt
public void writeShortOrInt(int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeShortOrInt
public static void writeShortOrInt(java.io.DataOutputStream dos, int value) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLongUTF
public void writeLongUTF(java.lang.String str) throws java.io.IOException
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:
java.io.IOException
-
countUTF
public static int countUTF(java.lang.String str)
-
-