/** * dump an array of bytes to a String * * @param data the byte array to be dumped * @param offset its offset, whatever that might mean * @param index initial index into the byte array * * @exception ArrayIndexOutOfBoundsException if the index is * outside the data array's bounds * @return output string */ public static String dump(final byte [] data, final long offset, final int index) { return dump(data, offset, index, Integer.MAX_VALUE); }
/** * dump an array of bytes to an OutputStream * * @param data the byte array to be dumped * @param offset its offset, whatever that might mean * @param stream the OutputStream to which the data is to be * written * @param index initial index into the byte array * * @exception IOException is thrown if anything goes wrong writing * the data to stream * @exception ArrayIndexOutOfBoundsException if the index is * outside the data array's bounds * @exception IllegalArgumentException if the output stream is * null */ public synchronized static void dump(final byte [] data, final long offset, final OutputStream stream, final int index) throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException { dump(data, offset, stream, index, Integer.MAX_VALUE); }
public static void main(String[] args) throws IOException { InputStream in = new FileInputStream(args[0]); byte[] b = IOUtils.toByteArray(in); in.close(); System.out.println(HexDump.dump(b, 0, 0)); } }
/** * dump an array of bytes to an OutputStream * * @param data the byte array to be dumped * @param offset its offset, whatever that might mean * @param stream the OutputStream to which the data is to be * written * @param index initial index into the byte array * @param length number of characters to output * * @exception IOException is thrown if anything goes wrong writing * the data to stream * @exception ArrayIndexOutOfBoundsException if the index is * outside the data array's bounds * @exception IllegalArgumentException if the output stream is * null */ public static void dump(final byte [] data, final long offset, final OutputStream stream, final int index, final int length) throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException { if (stream == null) { throw new IllegalArgumentException("cannot write to nullstream"); } OutputStreamWriter osw = new OutputStreamWriter(stream, UTF8); osw.write(dump(data, offset, index, length)); osw.flush(); }
dump(data, 0, out, start, data.length);
/** * Get an array of objects, some of which may implement POIFSViewable * * @return an array of Object; may not be null, but may be empty */ public Object[] getViewableArray() { String result = "<NO DATA>"; if(getSize() > 0) { // Get all the data into a single array byte[] data = IOUtils.safelyAllocate(getSize(), MAX_RECORD_LENGTH); int offset = 0; for(ByteBuffer buffer : _stream) { int length = Math.min(_block_size, data.length-offset); buffer.get(data, offset, length); offset += length; } result = HexDump.dump(data, 0, 0); } return new String[]{ result }; }
HexDump.dump( in, out, 0, 16 ); HexDump.dump( in, out, 0, nDumpSize ); nComplex -= nDumpSize; recordBytesRemaining -= nDumpSize; HexDump.dump( in, out, 0, 16 ); out.println( " Cache of size: " + HexDump.toHex( LittleEndian.readInt( in ) ) ); out.println( " Boundary top: " + HexDump.toHex( LittleEndian.readInt( in ) ) ); HexDump.dump( in1, out, 0, bytesToDump ); HexDump.dump( in, out, 0, nDumpSize ); remainingBytes -= nDumpSize;
HexDump.dump(data, 0, System.out, 0); } else { boolean dumpInterpretedRecords = cmdArgs.shouldDumpRecordInterpretations();
/** * dump debug info; use getText() to return a string * representation of the atom */ @Override public String toString() { StringBuffer out = new StringBuffer(); out.append( "TextCharsAtom:\n"); out.append( HexDump.dump(_text, 0, 0) ); return out.toString(); } }
/** * dump debug info; use getText() to return a string * representation of the atom */ @Override public String toString() { StringBuffer out = new StringBuffer(); out.append( "TextBytesAtom:\n"); out.append( HexDump.dump(_text, 0, 0) ); return out.toString(); } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("escape - function: "+escapeFunction+"\n"); sb.append(HexDump.dump(escapeData, 0, 0)); return sb.toString(); } }
/** * dump debug info; use getText() to return a string * representation of the atom */ public String toString() { StringBuffer out = new StringBuffer(); out.append( "TextBytesAtom:\n"); out.append( HexDump.dump(_text, 0, 0) ); return out.toString(); } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); InputStream in = new BufferedInputStream(new FileInputStream(file)); byte[] b = new byte[(int)file.length()]; in.read(b); System.out.println(HexDump.dump(b, 0, 0)); in.close(); } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); InputStream in = new BufferedInputStream(new FileInputStream(file)); byte[] b = new byte[(int)file.length()]; in.read(b); System.out.println(HexDump.dump(b, 0, 0)); in.close(); } }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getClass().getName()).append(" ["); sb.append("i=").append(_i); sb.append(" j=").append(_j); sb.append("]"); sb.append("\n"); sb.append(HexDump.dump(_s, 0, 0)); return sb.toString(); } }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getClass().getName()).append(" ["); sb.append("i=").append(_i); sb.append(" j=").append(_j); sb.append("]"); sb.append("\n"); sb.append(HexDump.dump(_s, 0, 0)); return sb.toString(); } }
public static void main(String[] args) throws IOException { InputStream in = new FileInputStream(args[0]); byte[] b = IOUtils.toByteArray(in); in.close(); System.out.println(HexDump.dump(b, 0, 0)); } }
private void dumpBit(QCBit bit, int index) { System.out.println(""); System.out.println("Dumping " + bit.getBitType() + " bit at " + index); System.out.println(" Is a " + bit.getThingType() + ", number is " + bit.getOptA()); System.out.println(" Starts at " + bit.getDataOffset() + " (0x" + Integer.toHexString(bit.getDataOffset()) + ")"); System.out.println(" Runs for " + bit.getLength() + " (0x" + Integer.toHexString(bit.getLength()) + ")"); System.out.println(HexDump.dump(bit.getData(), 0, 0)); } }