/** * get an unsigned int value from an InputStream * * @return the unsigned int (32-bit) value * @exception RuntimeException * wraps any IOException thrown from reading the stream. */ //@Override public long readUInt() { long retNum = readInt(); return retNum & 0x00FFFFFFFFL; }
entry.flags = leis.readUByte(); entry.reserved2 = leis.readInt(); entry.streamName = StringUtil.readUnicodeLE(leis, nameSize); leis.readShort();
/** * get an unsigned int value from an InputStream * * @return the unsigned int (32-bit) value * @exception RuntimeException * wraps any IOException thrown from reading the stream. */ //@Override public long readUInt() { long retNum = readInt(); return retNum & 0x00FFFFFFFFL; }
public void read(byte[] data, int offset){ @SuppressWarnings("resource") LittleEndianInputStream leis = new LittleEndianInputStream( new ByteArrayInputStream(data, offset, RECORD_LENGTH)); wmfsize = leis.readInt(); int left = leis.readInt(); int top = leis.readInt(); int right = leis.readInt(); int bottom = leis.readInt(); bounds.setBounds(left, top, right-left, bottom-top); int width = leis.readInt(); int height = leis.readInt(); size.setSize(width, height); zipsize = leis.readInt(); compression = leis.readUByte(); filter = leis.readUByte(); }
return 0; case BI_BITFIELDS: colorMaskB = leis.readInt(); colorMaskG = leis.readInt(); colorMaskR = leis.readInt(); return 3*LittleEndianConsts.INT_SIZE; default: return 0; case BI_BITFIELDS: colorMaskB = leis.readInt(); colorMaskG = leis.readInt(); colorMaskR = leis.readInt(); return 3*LittleEndianConsts.INT_SIZE; default:
public static HwmfPlaceableHeader readHeader(LittleEndianInputStream leis) throws IOException { leis.mark(LittleEndianConsts.INT_SIZE); int magic = leis.readInt(); if (magic == WMF_HEADER_MAGIC) { return new HwmfPlaceableHeader(leis); } else { leis.reset(); return null; } }
@Override public long init(LittleEndianInputStream leis, long recordId, long recordSize) throws IOException { //note that the first 2 uInts have been read off and the recordsize has //been decreased by 8 left = leis.readInt(); top = leis.readInt(); right = leis.readInt(); bottom = leis.readInt(); graphicsMode = leis.readUInt(); exScale = leis.readUInt(); eyScale = leis.readUInt(); int recordSizeInt = -1; if (recordSize < Integer.MAX_VALUE) { recordSizeInt = (int)recordSize; } else { throw new RecordFormatException("can't have text length > Integer.MAX_VALUE"); } //guarantee to read the rest of the EMRTextObjectRecord //emrtextbytes start after 7*4 bytes read above byte[] emrTextBytes = IOUtils.safelyAllocate(recordSizeInt-(7*LittleEndian.INT_SIZE), MAX_RECORD_LENGTH); IOUtils.readFully(leis, emrTextBytes); textObject = new EmrTextObject(emrTextBytes, getEncodingHint(), 20);//should be 28, but recordSizeInt has already subtracted 8 return recordSize; }
filesize = leis.readInt(); bytesLeft -= LittleEndianConsts.INT_SIZE;
@Override public int init(LittleEndianInputStream leis, long recordSize, int recordFunction) throws IOException { nextInChain = leis.readShort(); objectType = leis.readShort(); objectCount = leis.readInt(); regionSize = leis.readShort(); scanCount = leis.readShort(); maxScan = leis.readShort(); left = leis.readShort(); top = leis.readShort(); right = leis.readShort(); bottom = leis.readShort(); int size = 9*LittleEndianConsts.SHORT_SIZE+LittleEndianConsts.INT_SIZE; scanObjects = new WmfScanObject[scanCount]; for (int i=0; i<scanCount; i++) { size += (scanObjects[i] = new WmfScanObject()).init(leis); } return size; }
entry.flags = leis.readUByte(); entry.reserved2 = leis.readInt(); entry.streamName = StringUtil.readUnicodeLE(leis, nameSize); leis.readShort();