@Override public byte readByte() { return (byte)readUByte(); }
@Override public byte readByte() { return (byte)readUByte(); }
public byte readByte() { return (byte)readUByte(); } public int readUByte() {
public byte readByte() { return (byte)readUByte(); } public int readUByte() {
public int init(LittleEndianInputStream leis) throws IOException { // Values (1 byte): An 8-bit unsigned integer that defines how the palette entry is to be used. // The Values field MUST be 0x00 or one of the values in the PaletteEntryFlag Enumeration table. values = leis.readUByte(); // Blue (1 byte): An 8-bit unsigned integer that defines the blue intensity value for the palette entry. int blue = leis.readUByte(); // Green (1 byte): An 8-bit unsigned integer that defines the green intensity value for the palette entry. int green = leis.readUByte(); // Red (1 byte): An 8-bit unsigned integer that defines the red intensity value for the palette entry. int red = leis.readUByte(); colorRef = new Color(red, green, blue); return 4*LittleEndianConsts.BYTE_SIZE; }
protected int readRGBQuad(LittleEndianInputStream leis, int count) throws IOException { int size = 0; colorTable = new Color[count]; for (int i=0; i<count; i++) { int blue = leis.readUByte(); int green = leis.readUByte(); int red = leis.readUByte(); @SuppressWarnings("unused") int reserved = leis.readUByte(); colorTable[i] = new Color(red, green, blue); size += 4 * LittleEndianConsts.BYTE_SIZE; } return size; }
public int init(LittleEndianInputStream leis) throws IOException { height = leis.readShort(); width = leis.readShort(); escapement = leis.readShort(); orientation = leis.readShort(); weight = leis.readShort(); italic = leis.readByte() != 0; underline = leis.readByte() != 0; strikeOut = leis.readByte() != 0; charSet = FontCharset.valueOf(leis.readUByte()); outPrecision = WmfOutPrecision.valueOf(leis.readUByte()); clipPrecision = WmfClipPrecision.valueOf(leis.readUByte()); quality = WmfFontQuality.valueOf(leis.readUByte()); pitchAndFamily = leis.readUByte(); byte buf[] = new byte[32], b, readBytes = 0; do { if (readBytes == 32) { throw new IOException("Font facename can't be determined."); } buf[readBytes++] = b = leis.readByte(); } while (b != 0 && b != -1 && readBytes <= 32); facename = new String(buf, 0, readBytes-1, StandardCharsets.ISO_8859_1); return 5*LittleEndianConsts.SHORT_SIZE+8*LittleEndianConsts.BYTE_SIZE+readBytes; }
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(); }