Package org.exbin.bined
Class CharsetStreamTranslator
- java.lang.Object
-
- java.io.InputStream
-
- org.exbin.bined.CharsetStreamTranslator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
@ParametersAreNonnullByDefault public class CharsetStreamTranslator extends java.io.InputStream
Input stream translation class which converts from input charset to target charset.
-
-
Field Summary
Fields Modifier and Type Field Description static int
BYTE_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description CharsetStreamTranslator(java.nio.charset.Charset inputCharset, java.nio.charset.Charset outputCharset, java.io.InputStream source)
CharsetStreamTranslator(java.nio.charset.Charset inputCharset, java.nio.charset.Charset outputCharset, java.io.InputStream source, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
processNext()
int
read()
int
read(byte[] buffer, int offset, int length)
-
-
-
Field Detail
-
BYTE_BUFFER_SIZE
public static final int BYTE_BUFFER_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CharsetStreamTranslator
public CharsetStreamTranslator(java.nio.charset.Charset inputCharset, java.nio.charset.Charset outputCharset, java.io.InputStream source, int bufferSize)
-
CharsetStreamTranslator
public CharsetStreamTranslator(java.nio.charset.Charset inputCharset, java.nio.charset.Charset outputCharset, java.io.InputStream source)
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
processNext
public void processNext()
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-