byte[] destBytes = new byte[TMath.max(16, TMath.min(s.length, 1024))];
ByteBuffer dest = new ByteBuffer(destBytes);
while (!src.end()) {
charset.encode(src, dest);
write(destBytes, 0, dest.position());
dest.rewind(0);
}
}
public void print(char c) {
buffer[0] = c;