/** * 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); }
public String toString() { StringBuffer buffer = new StringBuffer(); String nl = System.getProperty("line.separator"); buffer.append("[ftGmo]" + nl); buffer.append(" reserved = ").append(HexDump.toHex(reserved)).append(nl); buffer.append("[/ftGmo]" + nl); return buffer.toString(); }
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[BOUNDSHEET]\n"); buffer.append(" .bof = ").append(HexDump.intToHex(getPositionOfBof())).append("\n"); buffer.append(" .options = ").append(HexDump.shortToHex(field_2_option_flags)).append("\n"); buffer.append(" .unicodeflag= ").append(HexDump.byteToHex(field_4_isMultibyteUnicode)).append("\n"); buffer.append(" .sheetname = ").append(field_5_sheetname).append("\n"); buffer.append("[/BOUNDSHEET]\n"); return buffer.toString(); }
private static String formatRecordDetails(int globalOffset, int sid, int size, int recordCounter) { return "Offset=" + HexDump.intToHex(globalOffset) + "(" + globalOffset + ")" + " recno=" + recordCounter + " sid=" + HexDump.shortToHex(sid) + " size=" + HexDump.shortToHex(size) + "(" + size + ")"; } }
@Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[ENDOBJECT]\n"); buffer.append(" .rt =").append(HexDump.shortToHex(rt)).append('\n'); buffer.append(" .grbitFrt =").append(HexDump.shortToHex(grbitFrt)).append('\n'); buffer.append(" .iObjectKind=").append(HexDump.shortToHex(iObjectKind)).append('\n'); buffer.append(" .reserved =").append(HexDump.toHex(reserved)).append('\n'); buffer.append("[/ENDOBJECT]\n"); return buffer.toString(); } }
@Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[CHARTFRTINFO]\n"); buffer.append(" .rt =").append(HexDump.shortToHex(rt)).append('\n'); buffer.append(" .grbitFrt =").append(HexDump.shortToHex(grbitFrt)).append('\n'); buffer.append(" .verOriginator=").append(HexDump.byteToHex(verOriginator)).append('\n'); buffer.append(" .verWriter =").append(HexDump.byteToHex(verOriginator)).append('\n'); buffer.append(" .nCFRTIDs =").append(HexDump.shortToHex(rgCFRTID.length)).append('\n'); buffer.append("[/CHARTFRTINFO]\n"); return buffer.toString(); } }
public String formatAsString() { StringBuilder sb = new StringBuilder(36); int PREFIX_LEN = "0x".length(); sb.append(HexDump.intToHex(_d1).substring(PREFIX_LEN)); sb.append("-"); sb.append(HexDump.shortToHex(_d2).substring(PREFIX_LEN)); sb.append("-"); sb.append(HexDump.shortToHex(_d3).substring(PREFIX_LEN)); sb.append("-"); String d4Chars = HexDump.longToHex(getD4()); sb.append(d4Chars.substring(PREFIX_LEN, PREFIX_LEN+4)); sb.append("-"); sb.append(d4Chars.substring(PREFIX_LEN+4)); return sb.toString(); }
@Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[TABLESTYLES]\n"); buffer.append(" .rt =").append(HexDump.shortToHex(rt)).append('\n'); buffer.append(" .grbitFrt=").append(HexDump.shortToHex(grbitFrt)).append('\n'); buffer.append(" .unused =").append(HexDump.toHex(unused)).append('\n'); buffer.append(" .cts=").append(HexDump.intToHex(cts)).append('\n'); buffer.append(" .rgchDefListStyle=").append(rgchDefListStyle).append('\n'); buffer.append(" .rgchDefPivotStyle=").append(rgchDefPivotStyle).append('\n'); buffer.append("[/TABLESTYLES]\n"); return buffer.toString(); } }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[ftPictFmla]\n"); sb.append(" .f2unknown = ").append(HexDump.intToHex(field_1_unknown_int)).append("\n"); if (field_2_refPtg == null) { sb.append(" .f3unknown = ").append(HexDump.toHex(field_2_unknownFormulaData)).append("\n"); } else { sb.append(" .formula = ").append(field_2_refPtg).append("\n"); } if (field_4_ole_classname != null) { sb.append(" .unicodeFlag = ").append(field_3_unicode_flag).append("\n"); sb.append(" .oleClassname = ").append(field_4_ole_classname).append("\n"); } if (field_4_unknownByte != null) { sb.append(" .f4unknown = ").append(HexDump.byteToHex(field_4_unknownByte.intValue())).append("\n"); } if (field_5_stream_id != null) { sb.append(" .streamId = ").append(HexDump.intToHex(field_5_stream_id.intValue())).append("\n"); } if (field_6_unknown.length > 0) { sb.append(" .f7unknown = ").append(HexDump.toHex(field_6_unknown)).append("\n"); } sb.append("[/ftPictFmla]"); return sb.toString(); }
stringBuf.append( HexDump.toHex( recordId ) ); stringBuf.append( " " ).append( recordName ).append( " [" ); stringBuf.append( HexDump.toHex( options ) ); stringBuf.append( ',' ); stringBuf.append( HexDump.toHex( recordBytesRemaining ) ); stringBuf.append( "] instance: " ); stringBuf.append( HexDump.toHex( ( (short) ( options >> 4 ) ) ) ); out.println(stringBuf); stringBuf.setLength(0); stringBuf.append( HexDump.toHex( n8 ) ); stringBuf.append( getBlipType( n8 ) ); stringBuf.append( " btMacOS: " ); n8 = (byte) in.read(); stringBuf.append( HexDump.toHex( n8 ) ); stringBuf.append( getBlipType( n8 ) ); out.println(stringBuf); HexDump.dump( in, out, 0, 16 ); remainingBytes -= 6; out.print( " " ); out.print( HexDump.toHex( n16 ) ); out.print( " (" ); int propertyId = n16 & (short) 0x3FFF; out.print( HexDump.toHex( n32 ) ); out.print( HexDump.toHex( n32 ) );
/** * <p>Converts the parameter to a hex value breaking the results into * lines.</p> * * @param value The value to convert * @param bytesPerLine The maximum number of bytes per line. The next byte * will be written to a new line * @return A String representing the array of bytes */ public static String toHex(final byte[] value, final int bytesPerLine) { if (value.length == 0) { return ": 0"; } final int digits = (int) Math.round(Math.log(value.length) / Math.log(10) + 0.5); StringBuilder retVal = new StringBuilder(); writeHex(retVal, 0, digits, ""); retVal.append(": "); for(int x=0, i=-1; x < value.length; x++) { if (++i == bytesPerLine) { retVal.append('\n'); writeHex(retVal, x, digits, ""); retVal.append(": "); i = 0; } else if (x>0) { retVal.append(", "); } retVal.append(toHex(value[x])); } return retVal.toString(); }
public String toString() { StringBuilder buffer = new StringBuilder(); buffer.append("[TABLE]\n"); buffer.append(" .range = ").append(getRange()).append("\n"); buffer.append(" .flags = ") .append(HexDump.byteToHex(field_5_flags)).append("\n"); buffer.append(" .alwaysClc= ").append(isAlwaysCalc()).append("\n"); buffer.append(" .reserved = ").append(HexDump.intToHex(field_6_res)).append("\n"); CellReference crRowInput = cr(field_7_rowInputRow, field_8_colInputRow); CellReference crColInput = cr(field_9_rowInputCol, field_10_colInputCol); buffer.append(" .rowInput = ").append(crRowInput.formatAsString()).append("\n"); buffer.append(" .colInput = ").append(crColInput.formatAsString()).append("\n"); buffer.append("[/TABLE]\n"); return buffer.toString(); }
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[STARTBLOCK]\n"); buffer.append(" .rt =").append(HexDump.shortToHex(rt)).append('\n'); buffer.append(" .grbitFrt =").append(HexDump.shortToHex(grbitFrt)).append('\n'); buffer.append(" .iObjectKind =").append(HexDump.shortToHex(iObjectKind)).append('\n'); buffer.append(" .iObjectContext =").append(HexDump.shortToHex(iObjectContext)).append('\n'); buffer.append(" .iObjectInstance1=").append(HexDump.shortToHex(iObjectInstance1)).append('\n'); buffer.append(" .iObjectInstance2=").append(HexDump.shortToHex(iObjectInstance2)).append('\n'); buffer.append("[/STARTBLOCK]\n"); return buffer.toString(); }
/** * Converts the parameter to a hex value. * * @param value The value to convert * @return The result right padded with 0 */ public static String toHex(short value) { StringBuilder sb = new StringBuilder(4); writeHex(sb, value & 0xFFFF, 4, ""); return sb.toString(); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[MSODRAWINGSELECTION]\n"); sb.append(" .rh =(").append(_header.debugFormatAsString()).append(")\n"); sb.append(" .cpsp =").append(HexDump.intToHex(_cpsp)).append('\n'); sb.append(" .dgslk =").append(HexDump.intToHex(_dgslk)).append('\n'); sb.append(" .spidFocus=").append(HexDump.intToHex(_spidFocus)).append('\n'); sb.append(" .shapeIds =("); for (int i = 0; i < _shapeIds.length; i++) { if (i > 0) { sb.append(", "); } sb.append(HexDump.intToHex(_shapeIds[i])); } sb.append(")\n"); sb.append("[/MSODRAWINGSELECTION]\n"); return sb.toString(); } }
/** * @return char array of 4 (zero padded) uppercase hex chars and prefixed with '0x' */ public static char[] longToHex(long value) { return toHexChars(value, 8); } /**
@Override protected void appendValueText(StringBuilder sb) { if (isBoolean()) { sb.append(" .boolVal = "); sb.append(getBooleanValue()); } else { sb.append(" .errCode = "); sb.append(FormulaError.forInt(getErrorValue()).getString()); sb.append(" (").append(HexDump.byteToHex(getErrorValue())).append(")"); } } @Override
public String formatAsString() { StringBuilder sb = new StringBuilder(36); int PREFIX_LEN = "0x".length(); sb.append(HexDump.intToHex(_d1), PREFIX_LEN, 8); sb.append("-"); sb.append(HexDump.shortToHex(_d2), PREFIX_LEN, 4); sb.append("-"); sb.append(HexDump.shortToHex(_d3), PREFIX_LEN, 4); sb.append("-"); char[] d4Chars = HexDump.longToHex(getD4()); sb.append(d4Chars, PREFIX_LEN, 4); sb.append("-"); sb.append(d4Chars, PREFIX_LEN + 4, 12); return sb.toString(); }