public static C2BConverter getInstance(ByteChunk output, String encoding) throws IOException { return new C2BConverter(output, encoding); }
/** Generate the bytes using the specified encoding */ public void convert(char c ) throws IOException { char[] tmp = new char[1]; tmp[0] = c; convert(tmp, 0, 1); }
/** Convert a message bytes chars to bytes */ public void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) return; ByteChunk orig=bb; setByteChunk( mb.getByteChunk()); bb.recycle(); bb.allocate( 32, -1 ); if( type==MessageBytes.T_STR ) { convert( mb.getString() ); // System.out.println("XXX Converting " + mb.getString() ); } else if( type==MessageBytes.T_CHARS ) { CharChunk charC=mb.getCharChunk(); convert( charC.getBuffer(), charC.getStart(), charC.getLength()); //System.out.println("XXX Converting " + mb.getCharChunk() ); } else { if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "XXX unknowon type {0}", type); } } //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength()); setByteChunk(orig); }
if (c2b == null) { bb = new ByteChunk(16); // small enough. c2b = C2BConverter.getInstance(bb, encoding); log("Unsafe: " + (char) c); c2b.convert((char) c); log("Unsafe: " + c); c2b.convert((char) d); i++;
/** Convert a message bytes chars to bytes */ public void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) return; ByteChunk orig=bb; setByteChunk( mb.getByteChunk()); bb.recycle(); bb.allocate( 32, -1 ); if( type==MessageBytes.T_STR ) { convert( mb.getString() ); // System.out.println("XXX Converting " + mb.getString() ); } else if( type==MessageBytes.T_CHARS ) { CharChunk charC=mb.getCharChunk(); convert( charC.getBuffer(), charC.getStart(), charC.getLength()); //System.out.println("XXX Converting " + mb.getCharChunk() ); } else { if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "XXX unknowon type {0}", type); } } //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength()); setByteChunk(orig); }
if (c2b == null) { bb = new ByteChunk(16); // small enough. c2b = C2BConverter.getInstance(bb, encoding); log("Unsafe: " + (char) c); c2b.convert((char) c); log("Unsafe: " + c); c2b.convert((char) d); i++;
/** Convert a message bytes chars to bytes */ public void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) return; ByteChunk orig=bb; setByteChunk( mb.getByteChunk()); bb.recycle(); bb.allocate( 32, -1 ); if( type==MessageBytes.T_STR ) { convert( mb.getString() ); // System.out.println("XXX Converting " + mb.getString() ); } else if( type==MessageBytes.T_CHARS ) { CharChunk charC=mb.getCharChunk(); convert( charC.getBuffer(), charC.getStart(), charC.getLength()); //System.out.println("XXX Converting " + mb.getCharChunk() ); } else { if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "XXX unknowon type {0}", type); } } //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength()); setByteChunk(orig); }
if (c2b == null) { bb = new ByteChunk(16); // small enough. c2b = C2BConverter.getInstance(bb, encoding); log("Unsafe: " + (char) c); c2b.convert((char) c); log("Unsafe: " + c); c2b.convert((char) d); i++;
/** Generate the bytes using the specified encoding */ public void convert(char c ) throws IOException { char[] tmp = new char[1]; tmp[0] = c; convert(tmp, 0, 1); }
public static C2BConverter getInstance(ByteChunk output, String encoding) throws IOException { return new C2BConverter(output, encoding); }
/** Convert a message bytes chars to bytes */ public void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) return; ByteChunk orig=bb; setByteChunk( mb.getByteChunk()); bb.recycle(); bb.allocate( 32, -1 ); if( type==MessageBytes.T_STR ) { convert( mb.getString() ); // System.out.println("XXX Converting " + mb.getString() ); } else if( type==MessageBytes.T_CHARS ) { CharChunk charC=mb.getCharChunk(); convert( charC.getBuffer(), charC.getStart(), charC.getLength()); //System.out.println("XXX Converting " + mb.getCharChunk() ); } else { if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "XXX unknowon type {0}", type); } } //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength()); setByteChunk(orig); }
if (c2b == null) { bb = new ByteChunk(16); // small enough. c2b = C2BConverter.getInstance(bb, encoding); log("Unsafe: " + (char) c); c2b.convert((char) c); log("Unsafe: " + c); c2b.convert((char) d); i++;
/** Generate the bytes using the specified encoding */ public void convert(char c ) throws IOException { char[] tmp = new char[1]; tmp[0] = c; convert(tmp, 0, 1); }
public static C2BConverter getInstance(ByteChunk output, String encoding) throws IOException { return new C2BConverter(output, encoding); }
/** Convert a message bytes chars to bytes */ public void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) return; ByteChunk orig=bb; setByteChunk( mb.getByteChunk()); bb.recycle(); bb.allocate( 32, -1 ); if( type==MessageBytes.T_STR ) { convert( mb.getString() ); // System.out.println("XXX Converting " + mb.getString() ); } else if( type==MessageBytes.T_CHARS ) { CharChunk charC=mb.getCharChunk(); convert( charC.getBuffer(), charC.getStart(), charC.getLength()); //System.out.println("XXX Converting " + mb.getCharChunk() ); } else { if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "XXX unknowon type {0}", type); } } //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength()); setByteChunk(orig); }
if (c2b == null) { bb = new ByteChunk(16); // small enough. c2b = C2BConverter.getInstance(bb, encoding); log("Unsafe: " + (char) c); c2b.convert((char) c); log("Unsafe: " + c); c2b.convert((char) d); i++;
/** Generate the bytes using the specified encoding */ public void convert(char c ) throws IOException { char[] tmp = new char[1]; tmp[0] = c; convert(tmp, 0, 1); }
public static C2BConverter getInstance(ByteChunk output, String encoding) throws IOException { return new C2BConverter(output, encoding); }
/** Convert a message bytes chars to bytes */ public void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) return; ByteChunk orig=bb; setByteChunk( mb.getByteChunk()); bb.recycle(); bb.allocate( 32, -1 ); if( type==MessageBytes.T_STR ) { convert( mb.getString() ); // System.out.println("XXX Converting " + mb.getString() ); } else if( type==MessageBytes.T_CHARS ) { CharChunk charC=mb.getCharChunk(); convert( charC.getBuffer(), charC.getStart(), charC.getLength()); //System.out.println("XXX Converting " + mb.getCharChunk() ); } else { if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "XXX unknowon type {0}", type); } } //System.out.println("C2B: XXX " + bb.getBuffer() + bb.getLength()); setByteChunk(orig); }
if (c2b == null) { bb = new ByteChunk(16); // small enough. c2b = C2BConverter.getInstance(bb, encoding); log("Unsafe: " + (char) c); c2b.convert((char) c); log("Unsafe: " + c); c2b.convert((char) d); i++;