label = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; fileName = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; command = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len;
private String read2004String(InputStream stream) throws IOException, TikaException { int stringLen = EndianUtils.readUShortLE(stream); byte[] stringData = new byte[stringLen]; IOUtils.readFully(stream, stringData); // Often but not always null terminated if (stringData[stringLen-1] == 0) { stringLen--; } String value = StringUtil.getFromCompressedUnicode(stringData, 0, stringLen); return value; }
if(valueType == 0x1e) { String val = StringUtil.getFromCompressedUnicode(value, 0, length);
/** Grabs the text. Uses the default codepage */ public String getText() { return StringUtil.getFromCompressedUnicode(_text,0,_text.length); }
/** Grabs the text. Uses the default codepage */ public String getText() { return StringUtil.getFromCompressedUnicode(_text,0,_text.length); }
private String read2004String(InputStream stream) throws IOException, TikaException { int stringLen = EndianUtils.readUShortLE(stream); byte[] stringData = new byte[stringLen]; IOUtils.readFully(stream, stringData); // Often but not always null terminated if (stringData[stringLen-1] == 0) { stringLen--; } String value = StringUtil.getFromCompressedUnicode(stringData, 0, stringLen); return value; }
private String read2004String(InputStream stream) throws IOException, TikaException { int stringLen = EndianUtils.readUShortLE(stream); byte[] stringData = new byte[stringLen]; IOUtils.readFully(stream, stringData); // Often but not always null terminated if (stringData[stringLen-1] == 0) { stringLen--; } String value = StringUtil.getFromCompressedUnicode(stringData, 0, stringLen); return value; }
/** * Constructs a single new string attribute from the id, type, * and the contents of the stream */ protected TNEFStringAttribute(int id, int type, InputStream inp) throws IOException { super(id, type, inp); String tmpData = null; byte[] data = getData(); if(getType() == TNEFProperty.TYPE_TEXT) { tmpData = StringUtil.getFromUnicodeLE(data); } else { tmpData = StringUtil.getFromCompressedUnicode( data, 0, data.length ); } // Strip off the null terminator if present if(tmpData.endsWith("\0")) { tmpData = tmpData.substring(0, tmpData.length()-1); } this.data = tmpData; }
public MAPIRtfAttribute(MAPIProperty property, int type, byte[] data) throws IOException { super(property, type, data); // Decompress it, removing any trailing padding as needed CompressedRTF rtf = new CompressedRTF(); byte[] tmp = rtf.decompress(new ByteArrayInputStream(data)); if(tmp.length > rtf.getDeCompressedSize()) { this.decompressed = new byte[rtf.getDeCompressedSize()]; System.arraycopy(tmp, 0, decompressed, 0, decompressed.length); } else { this.decompressed = tmp; } // Turn the RTF data into a more useful string this.data = StringUtil.getFromCompressedUnicode(decompressed, 0, decompressed.length); }
/** * Constructs a single new string attribute from the id, type, * and the contents of the stream */ protected TNEFStringAttribute(int id, int type, InputStream inp) throws IOException { super(id, type, inp); String tmpData = null; byte[] data = getData(); if(getType() == TNEFProperty.TYPE_TEXT) { tmpData = StringUtil.getFromUnicodeLE(data); } else { tmpData = StringUtil.getFromCompressedUnicode( data, 0, data.length ); } // Strip off the null terminator if present if(tmpData.endsWith("\0")) { tmpData = tmpData.substring(0, tmpData.length()-1); } this.data = tmpData; }
public MAPIRtfAttribute(MAPIProperty property, int type, byte[] data) throws IOException { super(property, type, data); // Decompress it, removing any trailing padding as needed CompressedRTF rtf = new CompressedRTF(); byte[] tmp = rtf.decompress(new ByteArrayInputStream(data)); if(tmp.length > rtf.getDeCompressedSize()) { this.decompressed = IOUtils.safelyAllocate(rtf.getDeCompressedSize(), MAX_RECORD_LENGTH); System.arraycopy(tmp, 0, decompressed, 0, decompressed.length); } else { this.decompressed = tmp; } // Turn the RTF data into a more useful string this.data = StringUtil.getFromCompressedUnicode(decompressed, 0, decompressed.length); }
if(valueType == 0x1e) { String val = StringUtil.getFromCompressedUnicode(value, 0, length);
if(valueType == 0x1e) { String val = StringUtil.getFromCompressedUnicode(value, 0, length);
lastEditUser = StringUtil.getFromCompressedUnicode(textBytes,0,(int)usernameLen);
ofs += LittleEndianConsts.SHORT_SIZE; int len = getStringLength(data, ofs); label = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; len = getStringLength(data, ofs); fileName = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; flags2 = LittleEndian.getShort(data, ofs); ofs += len; len = getStringLength(data, ofs); command = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len;
ofs += LittleEndianConsts.SHORT_SIZE; int len = getStringLength(data, ofs); label = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; len = getStringLength(data, ofs); fileName = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; flags2 = LittleEndian.getShort(data, ofs); ofs += len; len = getStringLength(data, ofs); command = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len;
label = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; fileName = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len; command = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); ofs += len;
lastEditUser = StringUtil.getFromCompressedUnicode(textBytes,0,(int)usernameLen);