public class C2BConverter extends Object
Modifier and Type | Field and Description |
---|---|
protected ByteChunk |
bb |
protected String |
enc |
protected CharsetEncoder |
encoder |
Constructor and Description |
---|
C2BConverter(ByteChunk output,
String encoding)
Create a converter, with bytes going to a byte buffer
|
C2BConverter(String encoding)
Create a converter
|
Modifier and Type | Method and Description |
---|---|
void |
convert(char c)
Generate the bytes using the specified encoding
|
void |
convert(char[] c,
int off,
int len)
Generate the bytes using the specified encoding
|
void |
convert(MessageBytes mb)
Convert a message bytes chars to bytes
|
void |
convert(String s)
Generate the bytes using the specified encoding
|
void |
convert(String s,
int off,
int len)
Generate the bytes using the specified encoding
|
void |
flushBuffer()
Flush any internal buffers into the ByteOutput or the internal
byte[]
|
ByteChunk |
getByteChunk() |
String |
getEncoding() |
static C2BConverter |
getInstance(ByteChunk output,
String encoding) |
void |
recycle()
Reset the internal state, empty the buffers.
|
void |
setByteChunk(ByteChunk bb) |
protected ByteChunk bb
protected final String enc
protected final CharsetEncoder encoder
public C2BConverter(ByteChunk output, String encoding) throws IOException
IOException
public C2BConverter(String encoding) throws IOException
IOException
public static C2BConverter getInstance(ByteChunk output, String encoding) throws IOException
IOException
public ByteChunk getByteChunk()
public String getEncoding()
public void setByteChunk(ByteChunk bb)
public void recycle()
public void convert(char[] c, int off, int len) throws IOException
IOException
public void convert(String s) throws IOException
IOException
public void convert(String s, int off, int len) throws IOException
IOException
public void convert(char c) throws IOException
IOException
public void convert(MessageBytes mb) throws IOException
IOException
public void flushBuffer() throws IOException
IOException
Copyright © 2015 Oracle Corporation. All rights reserved.