|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.CharsetConverter
public class CharsetConverter
P4Java charset converter class
Constructor Summary | |
---|---|
CharsetConverter(Charset fromCharset,
Charset toCharset)
Creates a new charset converted that decodes/encodes bytes in the specified non-null from/to charset objects specified. |
|
CharsetConverter(Charset fromCharset,
Charset toCharset,
boolean ignoreBOM)
Creates a new charset converted that decodes/encodes bytes in the specified non-null from/to charset objects specified. |
Method Summary | |
---|---|
byte[] |
clearUnderflow()
Get and clear the current converted underflow byte array. |
ByteBuffer |
convert(ByteBuffer from)
Convert a byte buffer by decoding using the fromCharset and encoding using the toCharset. |
ByteBuffer |
convert(ByteBuffer from,
ILookahead lookahead)
Convert a byte buffer by decoding using the fromCharset and encoding using the toCharset. |
ByteBuffer |
convert(CharBuffer from)
Converts a char buffer to a byte buffer using the toCharset. |
String |
getFromCharsetName()
Get charset name of from charset used to decode |
String |
getToCharsetName()
Get charset name of to charset used to encode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CharsetConverter(Charset fromCharset, Charset toCharset, boolean ignoreBOM)
fromCharset
- toCharset
- ignoreBOM
- - true to ignore any byte order marks written by the UTF-16
charset and omit them from all return byte bufferspublic CharsetConverter(Charset fromCharset, Charset toCharset)
fromCharset
- toCharset
- Method Detail |
---|
public String getFromCharsetName()
public String getToCharsetName()
public byte[] clearUnderflow()
ByteBuffer
and specified as
the from buffer on a call to convert(ByteBuffer)
to try convert
any remaining bytes.
convert(ByteBuffer)
did not have underflow.public ByteBuffer convert(CharBuffer from)
from
-
Buffer.position()
for starting
array offset, Buffer.limit()
for number of bytes to
read, and ByteBuffer.array()
for the byte[] itself.public ByteBuffer convert(ByteBuffer from, ILookahead lookahead)
convert(ByteBuffer)
. The from buffer specified
will be joined with the underflow from a previous call on subsequent
calls to convert(ByteBuffer)
.
from
- - byte buffer to convertlookahead
- - lookahead callback
Buffer.position()
for starting
array offset, Buffer.limit()
for number of bytes to
read, and ByteBuffer.array()
for the byte[] itself.public ByteBuffer convert(ByteBuffer from)
convert(ByteBuffer)
. The from buffer specified
will be joined with the underflow from a previous call on subsequent
calls to convert(ByteBuffer)
.
from
- - byte buffer to convert
Buffer.position()
for starting
array offset, Buffer.limit()
for number of bytes to
read, and ByteBuffer.array()
for the byte[] itself.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |