private void storeString() { if (getType() == Types.ASCII_STRING) { rawValue = value.getBytes(Charset.forName(encoding7Bit)); } else if (getType() == Types.UNICODE_STRING) { rawValue = StringUtil.getToUnicodeLE(value); } else { throw new IllegalArgumentException("Invalid type " + getType() + " for String Chunk"); } }
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", ""); }
/** * Sets the Encoding that will be used to decode any "7 bit" (non unicode) * data. This doesn't appear to be stored anywhere specific in the file, so * you may need to guess by looking at headers etc */ public void set7BitEncoding(String encoding) { this.encoding7Bit = encoding; // Re-read the String if we're a 7 bit one if (getType() == Types.ASCII_STRING) { parseString(); } }
for(Chunk c : mainChunks.getAll()) { if(c instanceof StringChunk) { if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { return true; for(Chunk c : nameIdChunks.getAll()) { if(c instanceof StringChunk) { if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { return true; for(Chunk c : rc.getAll()) { if(c instanceof StringChunk) { if( ((StringChunk)c).getType() == Types.ASCII_STRING ) { return true;