/** * Creates a new instance. * * @param fingerprints a list of SHA1 fingerprints */ public FingerprintTrustManagerFactory(byte[]... fingerprints) { if (fingerprints == null) { throw new NullPointerException("fingerprints"); } List<byte[]> list = new ArrayList<byte[]>(); for (byte[] f: fingerprints) { if (f == null) { break; } if (f.length != SHA1_BYTE_LEN) { throw new IllegalArgumentException("malformed fingerprint: " + ChannelBuffers.hexDump(ChannelBuffers.wrappedBuffer(f)) + " (expected: SHA1)"); } list.add(f.clone()); } this.fingerprints = list.toArray(new byte[list.size()][]); }
/** * Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a> * of the specified buffer's readable bytes. */ public static String hexDump(ChannelBuffer buffer) { return hexDump(buffer, buffer.readerIndex(), buffer.readableBytes()); }
+ Long.toHexString(cnxn.sessionId) + " queuedBuffer 0x" + ChannelBuffers.hexDump(cnxn.queuedBuffer)); LOG.trace(Long.toHexString(cnxn.sessionId) + " buf 0x" + ChannelBuffers.hexDump(buf)); LOG.trace(Long.toHexString(cnxn.sessionId) + " queuedBuffer 0x" + ChannelBuffers.hexDump(cnxn.queuedBuffer)); LOG.trace(Long.toHexString(cnxn.sessionId) + " queuedBuffer 0x" + ChannelBuffers.hexDump(cnxn.queuedBuffer)); LOG.trace(Long.toHexString(cnxn.sessionId) + " queuedBuffer 0x" + ChannelBuffers.hexDump(cnxn.queuedBuffer)); LOG.trace(Long.toHexString(cnxn.sessionId) + " queuedBuffer 0x" + ChannelBuffers.hexDump(cnxn.queuedBuffer));
LOG.trace(Long.toHexString(sessionId) + " bb 0x" + ChannelBuffers.hexDump( ChannelBuffers.copiedBuffer(dat))); + Long.toHexString(sessionId) + " bb 0x" + ChannelBuffers.hexDump( ChannelBuffers.copiedBuffer(dat))); LOG.trace(Long.toHexString(sessionId) + " bbLen 0x" + ChannelBuffers.hexDump( ChannelBuffers.copiedBuffer(dat))); LOG.trace(Long.toHexString(sessionId) + " bbLen 0x" + ChannelBuffers.hexDump( ChannelBuffers.copiedBuffer(bbLen)));
+ " produced=" + result.bytesProduced() + " remaining=" + nioInNetBuf.remaining() + " data=" + ChannelBuffers.hexDump(ChannelBuffers.wrappedBuffer(nioInNetBuf)));
"not an SSL/TLS record: " + ChannelBuffers.hexDump(in)); in.skipBytes(in.readableBytes()); if (closeOnSslException) {
private String extractId() { if (this.id == null) { this.id = ChannelBuffers.hexDump(payload, HEADER_PART_HASH_START, HEADER_PART_HASH_LENGTH); } return this.id; }
@Override public String toString() { return super.toString() + ChannelBuffers.hexDump(data); }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
@Override public String toString() { return super.toString() + ChannelBuffers.hexDump(data); }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
/** * Logs the specified event to the {@link InternalLogger} returned by * {@link #getLogger()}. If hex dump has been enabled for this handler, * the hex dump of the {@link ChannelBuffer} in a {@link MessageEvent} will * be logged together. */ protected void log(Direction direction, ChannelEvent evt) { // handle logging of message events (PDU, ChannelBuffer, etc.) if (evt instanceof MessageEvent) { MessageEvent me = (MessageEvent)evt; // handle logging of bytes write/read if ((me.getMessage() instanceof ChannelBuffer) && this.options.isLogBytesEnabled()) { ChannelBuffer buffer = (ChannelBuffer)me.getMessage(); if (direction == Direction.UP) { logger.info("read bytes: [{}]", hexDump(buffer)); } else if (direction == Direction.DOWN) { logger.info("write bytes: [{}]", hexDump(buffer)); } } } }
public static void main(String[] args) { FlvReader reader = new FlvReader("/home/felipe/codes/mconf/bbbot/bot/etc/sample.flv"); while(reader.hasNext()) { RtmpMessage message = reader.next(); logger.debug("{} {}", message, ChannelBuffers.hexDump(message.encode())); } reader.close(); }
public static void main(String[] args) { FlvReader reader = new FlvReader("home/apps/vod/IronMan.flv"); while(reader.hasNext()) { RtmpMessage message = reader.next(); logger.debug("{} {}", message, ChannelBuffers.hexDump(message.encode())); } reader.close(); }
logger.info("Bytes in buffer: [{}]", hexDump(buffer)); return null;
logger.info("Bytes in buffer: [{}]", hexDump(buffer)); return null;
logger.info("Bytes in buffer: [{}]", hexDump(buffer)); return null;
logger.info("Bytes in buffer: [{}]", hexDump(buffer)); return null;
ReadMessage m = handle.messages().syncWait(); System.out.println(m.bytes().toString(Charsets.Utf8())); System.out.println(ChannelBuffers.hexDump(m.bytes())); m.ack().sync();