|
||||||||||
| 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(java.nio.charset.Charset fromCharset,
java.nio.charset.Charset toCharset)
Creates a new charset converted that decodes/encodes bytes in the specified non-null from/to charset objects specified. |
|
CharsetConverter(java.nio.charset.Charset fromCharset,
java.nio.charset.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. |
java.nio.ByteBuffer |
convert(java.nio.ByteBuffer from)
Convert a byte buffer by decoding using the fromCharset and encoding using the toCharset. |
java.nio.ByteBuffer |
convert(java.nio.ByteBuffer from,
ILookahead lookahead)
Convert a byte buffer by decoding using the fromCharset and encoding using the toCharset. |
java.nio.ByteBuffer |
convert(java.nio.CharBuffer from)
Converts a char buffer to a byte buffer using the toCharset. |
java.lang.String |
getFromCharsetName()
Get charset name of from charset used to decode |
java.lang.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(java.nio.charset.Charset fromCharset,
java.nio.charset.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 buffers
public CharsetConverter(java.nio.charset.Charset fromCharset,
java.nio.charset.Charset toCharset)
fromCharset - toCharset - | Method Detail |
|---|
public java.lang.String getFromCharsetName()
public java.lang.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 java.nio.ByteBuffer convert(java.nio.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 java.nio.ByteBuffer convert(java.nio.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 java.nio.ByteBuffer convert(java.nio.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 | |||||||||