/** Convert buffer to a Hex String. * @param buffer the buffer to generate a hex byte summary from * @return A hex string */ public static String toHexString(ByteBuffer buffer) { if (buffer == null) return "null"; return TypeUtil.toHexString(toArray(buffer)); }
/** * @return the content as bytes * @see #getContentAsString() */ public byte[] getContent() { if (buffer == null) return new byte[0]; return BufferUtil.toArray(buffer); }
@Override public boolean content(ByteBuffer ref) { try { _content.write(BufferUtil.toArray(ref)); } catch (IOException e) { throw new RuntimeException(e); } return false; }
@Override public boolean content(ByteBuffer ref) { try { _content.write(BufferUtil.toArray(ref)); } catch (IOException e) { throw new RuntimeException(e); } return false; }
public void setContent(ByteBuffer content) { try { _content=new ByteArrayOutputStream(); _content.write(BufferUtil.toArray(content)); } catch (IOException e) { throw new RuntimeException(e); } } @Override
@Override public boolean content(ByteBuffer ref) { try { _content.write(BufferUtil.toArray(ref)); } catch (IOException e) { throw new RuntimeException(e); } return false; }
public void setContent(ByteBuffer content) { try { _content=new ByteArrayOutputStream(); _content.write(BufferUtil.toArray(content)); } catch (IOException e) { throw new RuntimeException(e); } } @Override
public void setContent(ByteBuffer content) { try { _content=new ByteArrayOutputStream(); _content.write(BufferUtil.toArray(content)); } catch (IOException e) { throw new RuntimeException(e); } } @Override
/** Convert buffer to a Hex String. * @param buffer the buffer to generate a hex byte summary from * @return A hex string */ public static String toHexString(ByteBuffer buffer) { if (buffer == null) return "null"; return TypeUtil.toHexString(toArray(buffer)); }
@Override public void input(ByteBuffer input) { if (LOG.isDebugEnabled()) { LOG.debug("input: {}",BufferUtil.toDetailString(input)); } // Set the data that is uncompressed to the deflater byte raw[] = BufferUtil.toArray(input); deflater.setInput(raw,0,raw.length); deflater.finish(); }
@Override public void input(ByteBuffer input) { if (LOG.isDebugEnabled()) { LOG.debug("input: {}",BufferUtil.toDetailString(input)); } // Set the data that is uncompressed to the deflater byte raw[] = BufferUtil.toArray(input); deflater.setInput(raw,0,raw.length); deflater.finish(); }
@Override public void input(ByteBuffer input) { if (LOG.isDebugEnabled()) { LOG.debug("input: {}",BufferUtil.toDetailString(input)); } // Set the data that is uncompressed to the deflater byte raw[] = BufferUtil.toArray(input); deflater.setInput(raw,0,raw.length); deflater.finish(); }
@Override public void input(ByteBuffer input) { if (LOG.isDebugEnabled()) { LOG.debug("inflate: {}",BufferUtil.toDetailString(input)); } // Set the data that is compressed to the inflater byte compressed[] = BufferUtil.toArray(input); inflater.setInput(compressed,0,compressed.length); }
@Override public void input(ByteBuffer input) { if (LOG.isDebugEnabled()) { LOG.debug("inflate: {}",BufferUtil.toDetailString(input)); LOG.debug("Input Data: {}",TypeUtil.toHexString(BufferUtil.toArray(input))); } // Set the data that is compressed (+ TAIL) to the inflater int len = input.remaining() + 4; byte raw[] = new byte[len]; int inlen = input.remaining(); input.slice().get(raw,0,inlen); System.arraycopy(TAIL,0,raw,inlen,TAIL.length); inflater.setInput(raw,0,raw.length); }
@Override public void input(ByteBuffer input) { if (LOG.isDebugEnabled()) { LOG.debug("inflate: {}",BufferUtil.toDetailString(input)); LOG.debug("Input Data: {}",TypeUtil.toHexString(BufferUtil.toArray(input))); } // Set the data that is compressed (+ TAIL) to the inflater int len = input.remaining() + 4; byte raw[] = new byte[len]; int inlen = input.remaining(); input.slice().get(raw,0,inlen); System.arraycopy(TAIL,0,raw,inlen,TAIL.length); inflater.setInput(raw,0,raw.length); }
return BufferUtil.toArray(buffer);
if (frame.hasPayload()) pongBuf = BufferUtil.toArray(frame.getPayload());