/** * Uses a 512-byte array to create a FKP * @param textPieces TODO */ public FormattedDiskPage(byte[] documentStream, int offset, NodeHelper fc2Cp) { _crun = LittleEndian.getUnsignedByte(documentStream, offset + 511); _fkp = documentStream; _offset = offset; _fc2Cp = fc2Cp; } /**
/** * Uses a 512-byte array to create a FKP */ public FormattedDiskPage(byte[] documentStream, int offset) { _crun = LittleEndian.getUnsignedByte(documentStream, offset + 511); _fkp = documentStream; _offset = offset; } /**
/** * Uses a 512-byte array to create a FKP */ public FormattedDiskPage(byte[] fkp) { _crun = LittleEndian.getUnsignedByte(fkp, 511); _fkp = fkp; } /**
/** * Uses a 512-byte array to create a FKP * @param textPieces TODO */ public FormattedDiskPage(byte[] documentStream, int offset, NodeHelper fc2Cp) { _crun = LittleEndian.getUnsignedByte(documentStream, offset + 511); _fkp = documentStream; _offset = offset; _fc2Cp = fc2Cp; } /**
/** * Gets the chpx for the character run at index in this fkp. * * @param index The index of the chpx to get. * @return a chpx grpprl. */ protected byte[] getGrpprl(int index) { int chpxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + (((_crun + 1) * 4) + index)); //optimization if offset == 0 use "Normal" style if(chpxOffset == 0) { return new byte[0]; } int size = LittleEndian.getUnsignedByte(_fkp, _offset + chpxOffset); byte[] chpx = new byte[size]; System.arraycopy(_fkp, _offset + ++chpxOffset, chpx, 0, size); return chpx; }
/** * Gets the chpx for the character run at index in this fkp. * * @param index The index of the chpx to get. * @return a chpx grpprl. */ protected byte[] getGrpprl(int index) { int chpxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + (((_crun + 1) * 4) + index)); //optimization if offset == 0 use "Normal" style if(chpxOffset == 0) { return new byte[0]; } int size = LittleEndian.getUnsignedByte(_fkp, _offset + chpxOffset); byte[] chpx = new byte[size]; System.arraycopy(_fkp, _offset + ++chpxOffset, chpx, 0, size); return chpx; }
/** * Gets the papx grpprl for the paragraph at index in this fkp. * * @param index The index of the papx to get. * @return a papx grpprl. */ protected byte[] getGrpprl(int index) { int papxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + (((_crun + 1) * FC_SIZE) + (index * BX_SIZE))); int size = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + papxOffset); if(size == 0) { size = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + ++papxOffset); } else { size--; } byte[] papx = new byte[size]; System.arraycopy(_fkp, _offset + ++papxOffset, papx, 0, size); return papx; }
/** * Gets the chpx for the character run at index in this fkp. * * @param index The index of the chpx to get. * @return a chpx grpprl. */ protected byte[] getGrpprl(int index) { int chpxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, _offset + (((_crun + 1) * 4) + index)); //optimization if offset == 0 use "Normal" style if(chpxOffset == 0) { return new byte[0]; } int size = LittleEndian.getUnsignedByte(_fkp, _offset + chpxOffset); byte[] chpx = new byte[size]; System.arraycopy(_fkp, _offset + ++chpxOffset, chpx, 0, size); return chpx; }
/** * Gets the chpx for the character run at index in this fkp. * * @param index The index of the chpx to get. * @return a chpx grpprl. */ public byte[] getGrpprl(int index) { int chpxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, ((_crun + 1) * 4) + index); //optimization if offset == 0 use "Normal" style if(chpxOffset == 0) { return new byte[0]; } int size = LittleEndian.getUnsignedByte(_fkp, chpxOffset); byte[] chpx = new byte[size]; System.arraycopy(_fkp, ++chpxOffset, chpx, 0, size); return chpx; } }
/** * Gets the papx for the pagraph at index in this fkp. * * @param index The index of the papx to get. * @return a papx grpprl. */ public byte[] getGrpprl(int index) { int papxOffset = 2 * LittleEndian.getUnsignedByte(_fkp, ((_crun + 1) * 4) + (index * 13)); int size = 2 * LittleEndian.getUnsignedByte(_fkp, papxOffset); if(size == 0) { size = 2 * LittleEndian.getUnsignedByte(_fkp, ++papxOffset); } else { size--; } byte[] papx = new byte[size]; System.arraycopy(_fkp, ++papxOffset, papx, 0, size); return papx; } }
/** * Build an instance of <code>OEPlaceholderAtom</code> from on-disk data */ protected OEPlaceholderAtom(byte[] source, int start, int len) { _header = new byte[8]; int offset = start; System.arraycopy(source,start,_header,0,8); offset += _header.length; placementId = LittleEndian.getInt(source, offset); offset += 4; placeholderId = LittleEndian.getUnsignedByte(source, offset); offset++; placeholderSize = LittleEndian.getUnsignedByte(source, offset); offset++; }
while (offset < grpprl.length) switch (LittleEndian.getUnsignedByte(grpprl, offset++))
public short getIstd() { if ( _buf == null ) return 0; byte[] buf = getGrpprl(); if (buf.length == 0) { return 0; } if (buf.length == 1) { return (short)LittleEndian.getUnsignedByte(buf, 0); } return LittleEndian.getShort(buf); }
public Ffn(byte[] buf, int offset) { int offsetTmp = offset; _cbFfnM1 = LittleEndian.getUnsignedByte(buf,offset); offset += LittleEndian.BYTE_SIZE; _info = buf[offset]; offset += LittleEndian.BYTE_SIZE; _wWeight = LittleEndian.getShort(buf, offset); offset += LittleEndian.SHORT_SIZE; _chs = buf[offset]; offset += LittleEndian.BYTE_SIZE; _ixchSzAlt = buf[offset]; offset += LittleEndian.BYTE_SIZE; // read panose and fs so we can write them back out. System.arraycopy(buf, offset, _panose, 0, _panose.length); offset += _panose.length; System.arraycopy(buf, offset, _fontSig, 0, _fontSig.length); offset += _fontSig.length; offsetTmp = offset - offsetTmp; _xszFfnLength = (this.getSize() - offsetTmp)/2; _xszFfn = new char[_xszFfnLength]; for(int i = 0; i < _xszFfnLength; i++) { _xszFfn[i] = (char)LittleEndian.getShort(buf, offset); offset += LittleEndian.SHORT_SIZE; } }
public void read(byte[] data, int offset){ int pos = offset; wmfsize = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; int left = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; int top = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; int right = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; int bottom = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; bounds = new Rectangle(left, top, right-left, bottom-top); int width = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; int height = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; size = new Dimension(width, height); zipsize = LittleEndian.getInt(data, pos); pos += LittleEndian.INT_SIZE; compression = LittleEndian.getUnsignedByte(data, pos); pos++; filter = LittleEndian.getUnsignedByte(data, pos); pos++; }
ch.length = (int)LittleEndian.getUInt(data, offset + 12); ch.unknown2 = LittleEndian.getShort(data, offset + 16); ch.unknown3 = (short)LittleEndian.getUnsignedByte(data, offset + 18); ch.unknown2 = (short)LittleEndian.getUnsignedByte(data, offset + 4); ch.unknown3 = (short)LittleEndian.getUnsignedByte(data, offset + 5); ch.unknown1 = LittleEndian.getShort(data, offset + 6); ch.length = (int)LittleEndian.getUInt(data, offset + 8);
_operand = LittleEndian.getUnsignedByte(grpprl, offset); _sizeNeeded = 3; break;
_operand = LittleEndian.getUnsignedByte(grpprl, offset); _sizeNeeded = 3; break;
_operand = LittleEndian.getUnsignedByte(grpprl, offset); _sizeNeeded = 3; break;
opSize = LittleEndian.getUnsignedByte(grpprl, offset); offset++;