static private String hex(SocketAddress address) { if( address instanceof InetSocketAddress ) { InetSocketAddress isa = (InetSocketAddress)address; return HexSupport.toHexFromBuffer(new Buffer(isa.getAddress().getAddress()))+Integer.toHexString(isa.getPort()); } return ""; }
public String hex() { return HexSupport.toHexFromBuffer(this); }
public String hex() { return HexSupport.toHexFromBuffer(this); }
public String hex() { return HexSupport.toHexFromBuffer(this); }
static private String hex(SocketAddress address) { if( address instanceof InetSocketAddress ) { InetSocketAddress isa = (InetSocketAddress)address; return HexSupport.toHexFromBuffer(new Buffer(isa.getAddress().getAddress()))+Integer.toHexString(isa.getPort()); } return ""; }
@Override public String toString() { int size = length; boolean asciiPrintable = true; for( int i=0; i < size; i++ ) { int c = data[offset+i] & 0xFF; if( c > 126 || c < 32 ) { // not a printable char if( !(c=='\n' || c=='\r' | c=='\n' | c==27) ) { // except these. asciiPrintable = false; break; } } } if( asciiPrintable ) { return "ascii: "+ascii(); } else { return "hex: "+HexSupport.toHexFromBuffer(this); } }
@Override public String toString() { int size = length; boolean asciiPrintable = true; for( int i=0; i < size; i++ ) { int c = data[offset+i] & 0xFF; if( c > 126 || c < 32 ) { // not a printable char if( !(c=='\n' || c=='\r' | c=='\n' | c==27) ) { // except these. asciiPrintable = false; break; } } } if( asciiPrintable ) { return "ascii: "+ascii(); } else { return "hex: "+HexSupport.toHexFromBuffer(this); } }
@Override public String toString() { int size = length; boolean asciiPrintable = true; for( int i=0; i < size; i++ ) { int c = data[offset+i] & 0xFF; if( c > 126 || c < 32 ) { // not a printable char if( !(c=='\n' || c=='\r' | c=='\n' | c==27) ) { // except these. asciiPrintable = false; break; } } } if( asciiPrintable ) { return "ascii: "+ascii(); } else { return "hex: "+HexSupport.toHexFromBuffer(this); } }