/** * Parses as non-unicode, supposedly 7 bit CP1252 data * and returns the string that that yields. */ protected static String parseAs7BitData(byte[] data) { return parseAs7BitData(data, DEFAULT_ENCODING); } /**
/** * Returns the data, formatted as a string assuming it * was a non-unicode string. * If your data isn't in fact stored as basically * ASCII, don't expect this to return much of any * sense.... * @return the data formatted as a string */ public String getAs7bitString() { return StringChunk.parseAs7BitData(value); } }
/** * Returns the data, formatted as a string assuming it was a non-unicode * string. If your data isn't in fact stored as basically ASCII, don't * expect this to return much of any sense.... * * @return the data formatted as a string */ public String getAs7bitString() { return StringChunk.parseAs7BitData(value); } }
/** * Parses as non-unicode, supposedly 7 bit CP1252 data and returns the * string that that yields. */ protected static String parseAs7BitData(byte[] data) { return parseAs7BitData(data, DEFAULT_ENCODING); }
private void parseString() { String tmpValue; switch(type) { case Types.ASCII_STRING: tmpValue = parseAs7BitData(rawValue, encoding7Bit); break; case Types.UNICODE_STRING: tmpValue = StringUtil.getFromUnicodeLE(rawValue); break; default: throw new IllegalArgumentException("Invalid type " + type + " for String Chunk"); } // Clean up this.value = tmpValue.replace("\0", ""); }
private void parseString() { String tmpValue; if (getType() == Types.ASCII_STRING) { tmpValue = parseAs7BitData(rawValue, encoding7Bit); } else if (getType() == Types.UNICODE_STRING) { tmpValue = StringUtil.getFromUnicodeLE(rawValue); } else { throw new IllegalArgumentException("Invalid type " + getType() + " for String Chunk"); } // Clean up this.value = tmpValue.replace("\0", ""); }