@Override public int readUByte() { byte buf[] = new byte[1]; try { checkEOF(read(buf), 1); } catch (IOException e) { throw new RuntimeException(e); } return LittleEndian.getUByte(buf); }
lastRow = LittleEndian.getUShort(data, offset); offset += LittleEndian.SHORT_SIZE; firstCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; lastCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; charCount = LittleEndian.getUShort(data, offset); throw new RecordFormatException("Character count must be >= 2"); charType = LittleEndian.getUByte(data, offset);
/** * Uses a 512-byte array to create a FKP */ public FormattedDiskPage(byte[] documentStream, int offset) { _crun = LittleEndian.getUByte(documentStream, offset + 511); _fkp = documentStream; _offset = offset; }
/** * 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.getUByte(_fkp, _offset + (((_crun + 1) * FC_SIZE) + (index * BX_SIZE))); int size = 2 * LittleEndian.getUByte(_fkp, _offset + papxOffset); if(size == 0) { size = 2 * LittleEndian.getUByte(_fkp, _offset + ++papxOffset); } else { size--; } byte[] papx = IOUtils.safelyAllocate(size, 512); 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. */ @Override protected byte[] getGrpprl(int index) { int chpxOffset = 2 * LittleEndian.getUByte(_fkp, _offset + (((_crun + 1) * 4) + index)); //optimization if offset == 0 use "Normal" style if(chpxOffset == 0) { return new byte[0]; } int size = LittleEndian.getUByte(_fkp, _offset + chpxOffset); byte[] chpx = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH); System.arraycopy(_fkp, _offset + ++chpxOffset, chpx, 0, size); return chpx; }
/** * unsigned 1 byte * * @return * @throws IOException */ public short uint8() throws IOException { if (ensure(1) == 0) return -1; return LittleEndian.getUByte(buf); }
/** * Build an instance of {@code OEPlaceholderAtom} 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.getUByte(source, offset); offset++; placeholderSize = LittleEndian.getUByte(source, offset); offset++; unusedShort = LittleEndian.getShort(source, offset); }
@Override public int readUByte() { byte buf[] = new byte[1]; try { checkEOF(read(buf), 1); } catch (IOException e) { throw new RuntimeException(e); } return LittleEndian.getUByte(buf); }
protected void fillFields( byte[] data, int offset ) { field_1_iStartAt = LittleEndian.getInt( data, 0x0 + offset ); field_2_nfc = data[ 0x4 + offset ]; field_3_info = data[ 0x5 + offset ]; field_4_rgbxchNums = LittleEndian.getByteArray( data, 0x6 + offset,9 ); field_5_ixchFollow = data[ 0xf + offset ]; field_6_dxaIndentSav = LittleEndian.getInt( data, 0x10 + offset ); field_7_unused2 = LittleEndian.getInt( data, 0x14 + offset ); field_8_cbGrpprlChpx = LittleEndian.getUByte( data, 0x18 + offset ); field_9_cbGrpprlPapx = LittleEndian.getUByte( data, 0x19 + offset ); field_10_ilvlRestartLim = LittleEndian.getUByte( data, 0x1a + offset ); field_11_grfhic = new Grfhic( data, 0x1b + offset ); }
protected void fillFields( byte[] data, int offset ) { field_1_iStartAt = LittleEndian.getInt( data, 0x0 + offset ); field_2_nfc = data[ 0x4 + offset ]; field_3_info = data[ 0x5 + offset ]; field_4_rgbxchNums = LittleEndian.getByteArray( data, 0x6 + offset,9 ); field_5_ixchFollow = data[ 0xf + offset ]; field_6_dxaIndentSav = LittleEndian.getInt( data, 0x10 + offset ); field_7_unused2 = LittleEndian.getInt( data, 0x14 + offset ); field_8_cbGrpprlChpx = LittleEndian.getUByte( data, 0x18 + offset ); field_9_cbGrpprlPapx = LittleEndian.getUByte( data, 0x19 + offset ); field_10_ilvlRestartLim = LittleEndian.getUByte( data, 0x1a + offset ); field_11_grfhic = new Grfhic( data, 0x1b + offset ); }
public short getIstd() { if ( _buf == null ) return 0; byte[] buf = getGrpprl(); if (buf.length == 0) { return 0; } if (buf.length == 1) { return LittleEndian.getUByte(buf, 0); } return LittleEndian.getShort(buf); }
public Ffn(byte[] buf, int offset) { int offsetTmp = offset; _cbFfnM1 = LittleEndian.getUByte(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 SSSlideInfoAtom(byte[] source, int offset, int len) { int ofs = offset; // Sanity Checking if(len != 24) len = 24; assert(source.length >= offset+len); // Get the header _header = LittleEndian.getByteArray(source,ofs,8); ofs += _header.length; assert(LittleEndian.getShort(_header, 0) == 0); assert(LittleEndian.getShort(_header, 2) == RecordTypes.SSSlideInfoAtom.typeID); assert(LittleEndian.getShort(_header, 4) == 0x10); assert(LittleEndian.getShort(_header, 6) == 0); _slideTime = LittleEndian.getInt(source, ofs); assert(0 <= _slideTime && _slideTime <= 86399000); ofs += LittleEndianConsts.INT_SIZE; _soundIdRef = LittleEndian.getInt(source, ofs); ofs += LittleEndianConsts.INT_SIZE; _effectDirection = LittleEndian.getUByte(source, ofs); ofs += LittleEndianConsts.BYTE_SIZE; _effectType = LittleEndian.getUByte(source, ofs); ofs += LittleEndianConsts.BYTE_SIZE; _effectTransitionFlags = LittleEndian.getShort(source, ofs); ofs += LittleEndianConsts.SHORT_SIZE; _speed = LittleEndian.getUByte(source, ofs); ofs += LittleEndianConsts.BYTE_SIZE; _unused = LittleEndian.getByteArray(source,ofs,3); }
lastRow = LittleEndian.getUShort(data, offset); offset += LittleEndian.SHORT_SIZE; firstCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; lastCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; charCount = LittleEndian.getUShort(data, offset); throw new RecordFormatException("Character count must be >= 2"); charType = LittleEndian.getUByte(data, offset);
lastRow = LittleEndian.getUShort(data, offset); offset += LittleEndian.SHORT_SIZE; firstCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; lastCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; charCount = LittleEndian.getUShort(data, offset); "Character count must be >= 2"); charType = LittleEndian.getUByte(data, offset);
lastRow = LittleEndian.getUShort(data, offset); offset += LittleEndian.SHORT_SIZE; firstCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; lastCol = LittleEndian.getUByte(data, offset); offset += LittleEndian.BYTE_SIZE; charCount = LittleEndian.getUShort(data, offset); "Character count must be >= 2"); charType = LittleEndian.getUByte(data, offset);
flags2 = LittleEndian.getShort(data, ofs); ofs += LittleEndianConsts.SHORT_SIZE; len = LittleEndian.getUByte(data, ofs); unknown1 = new byte[len]; ofs += len;
_cchPicName = LittleEndian.getUByte( dataStream, offset ); offset += 1;
_cchPicName = LittleEndian.getUByte( dataStream, offset ); offset += 1;
ch.setLength((int)LittleEndian.getUInt(data, offset + 12)); ch.setUnknown2(LittleEndian.getShort(data, offset + 16)); ch.setUnknown3(LittleEndian.getUByte(data, offset + 18)); ch.setUnknown2(LittleEndian.getUByte(data, offset + 4)); ch.setUnknown3(LittleEndian.getUByte(data, offset + 5)); ch.setUnknown1(LittleEndian.getShort(data, offset + 6)); ch.setLength((int)LittleEndian.getUInt(data, offset + 8));