Package org.jcodings.transcode
Class EConv
- java.lang.Object
-
- org.jcodings.transcode.EConv
-
- All Implemented Interfaces:
EConvFlags
public final class EConv extends java.lang.Object implements EConvFlags
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EConv.EConvElement
static class
EConv.LastError
-
Field Summary
Fields Modifier and Type Field Description byte[]
destination
Encoding
destinationEncoding
EConv.EConvElement[]
elements
(package private) int
flags
(package private) Buffer
inBuf
EConv.LastError
lastError
Transcoding
lastTranscoding
(package private) static int[]
NULL_POINTER
(package private) static byte[]
NULL_STRING
(package private) int
numFinished
int
numTranscoders
byte[]
replacementEncoding
int
replacementLength
byte[]
replacementString
byte[]
source
Encoding
sourceEncoding
(package private) boolean
started
-
Fields inherited from interface org.jcodings.transcode.EConvFlags
AFTER_OUTPUT, CR_NEWLINE_DECORATOR, CRLF_NEWLINE_DECORATOR, DECORATOR_MASK, ERROR_HANDLER_MASK, INVALID_MASK, INVALID_REPLACE, MAX_ECFLAGS_DECORATORS, NEWLINE_DECORATOR_MASK, NEWLINE_DECORATOR_READ_MASK, NEWLINE_DECORATOR_WRITE_MASK, PARTIAL_INPUT, STATEFUL_DECORATOR_MASK, UNDEF_HEX_CHARREF, UNDEF_MASK, UNDEF_REPLACE, UNIVERSAL_NEWLINE_DECORATOR, XML_ATTR_CONTENT_DECORATOR, XML_ATTR_QUOTE_DECORATOR, XML_TEXT_DECORATOR
-
-
Constructor Summary
Constructors Constructor Description EConv(int nHint)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addConverter(byte[] source, byte[] destination, int n)
(package private) void
addTranscoderAt(Transcoder transcoder, int i)
private static byte[]
allocateConvertedString(byte[] source, byte[] destination, byte[] str, int strP, int strLen, byte[] callerDstBuf, Ptr dstLenPtr)
void
binmode()
void
close()
EConvResult
convert(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags)
private EConvResult
convertInternal(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags)
private EConvResult
convertInternalResult(EConvResult res, Ptr resultPosition)
(package private) boolean
decorateAt(byte[] decorator, int n)
(package private) boolean
decorateAtFirst(byte[] decorator)
(package private) boolean
decorateAtLast(byte[] decorator)
(package private) static boolean
decorator(byte[] source, byte[] destination)
byte[]
encodingToInsertOutput()
boolean
equals(java.lang.Object other)
int
insertOutput(byte[] str, int strP, int strLen, byte[] strEncoding)
int
makeReplacement()
private static boolean
memcmp(byte[] a, byte[] b, int len)
private int
outputHexCharref()
(package private) int
outputReplacementCharacter()
void
putback(byte[] bytes, int p, int n)
int
putbackable()
int
setReplacement(byte[] str, int p, int len, byte[] encname)
java.lang.String
toString()
java.lang.String
toStringFull()
private EConvResult
transConv(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, Ptr resultPositionPtr)
private EConvResult
transConvNeedReport(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, Ptr resultPositionPtr, int sweepStart, int needReportIndex)
private int
transSweep(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, int start)
-
-
-
Field Detail
-
flags
int flags
-
source
public byte[] source
-
destination
public byte[] destination
-
started
boolean started
-
replacementString
public byte[] replacementString
-
replacementLength
public int replacementLength
-
replacementEncoding
public byte[] replacementEncoding
-
inBuf
Buffer inBuf
-
elements
public EConv.EConvElement[] elements
-
numTranscoders
public int numTranscoders
-
numFinished
int numFinished
-
lastTranscoding
public Transcoding lastTranscoding
-
lastError
public final EConv.LastError lastError
-
sourceEncoding
public Encoding sourceEncoding
-
destinationEncoding
public Encoding destinationEncoding
-
NULL_STRING
static final byte[] NULL_STRING
-
NULL_POINTER
static final int[] NULL_POINTER
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
decorator
static boolean decorator(byte[] source, byte[] destination)
-
addTranscoderAt
void addTranscoderAt(Transcoder transcoder, int i)
-
transSweep
private int transSweep(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, int start)
-
transConv
private EConvResult transConv(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, Ptr resultPositionPtr)
-
transConvNeedReport
private EConvResult transConvNeedReport(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, Ptr resultPositionPtr, int sweepStart, int needReportIndex)
-
convertInternal
private EConvResult convertInternal(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags)
-
convertInternalResult
private EConvResult convertInternalResult(EConvResult res, Ptr resultPosition)
-
convert
public EConvResult convert(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags)
-
outputHexCharref
private int outputHexCharref()
-
encodingToInsertOutput
public byte[] encodingToInsertOutput()
-
allocateConvertedString
private static byte[] allocateConvertedString(byte[] source, byte[] destination, byte[] str, int strP, int strLen, byte[] callerDstBuf, Ptr dstLenPtr)
-
insertOutput
public int insertOutput(byte[] str, int strP, int strLen, byte[] strEncoding)
-
close
public void close()
-
putbackable
public int putbackable()
-
putback
public void putback(byte[] bytes, int p, int n)
-
addConverter
public boolean addConverter(byte[] source, byte[] destination, int n)
-
decorateAt
boolean decorateAt(byte[] decorator, int n)
-
decorateAtFirst
boolean decorateAtFirst(byte[] decorator)
-
decorateAtLast
boolean decorateAtLast(byte[] decorator)
-
binmode
public void binmode()
-
makeReplacement
public int makeReplacement()
-
setReplacement
public int setReplacement(byte[] str, int p, int len, byte[] encname)
-
outputReplacementCharacter
int outputReplacementCharacter()
-
toStringFull
public java.lang.String toStringFull()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
memcmp
private static boolean memcmp(byte[] a, byte[] b, int len)
-
-