public int readUnsignedShort() throws IOException { return mDelegate.readUnsignedShort(); }
@Override public int readUnsignedShort() { try { return input.readUnsignedShort(); } catch (IOException e) { throw new IllegalStateException(e); } }
public int readUnsignedShort() throws IOException { return mDelegate.readUnsignedShort(); }
@Override public int readInt(DataInput input) throws IOException { return input.readUnsignedShort(); }
@Override public int readUnsignedShort() { try { return input.readUnsignedShort(); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public int readUnsignedShort() { try { return input.readUnsignedShort(); } catch (IOException e) { throw new IllegalStateException(e); } }
private void readInterfaces(final DataInput di) throws IOException { final int count = di.readUnsignedShort(); di.skipBytes(count * 2); // count * u2 }
@Override public int readUnsignedShort() { try { return input.readUnsignedShort(); } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void readFields(DataInput in) throws IOException { length = in.readUnsignedShort(); if (bytes == null || bytes.length < length) bytes = new byte[length]; in.readFully(bytes, 0, length); }
private void readVersion(final DataInput di) throws IOException { // sequence: minor version, major version (argument_index is 1-based) if (logger.isDebugEnabled()) { print("Java Class version %2$d.%1$d", di.readUnsignedShort(), di.readUnsignedShort()); } else { di.skipBytes(4); } }
private void readConstantPoolEntries(final DataInput di) throws IOException { final int count = di.readUnsignedShort(); constantPool = new Object[count]; for (int i = 1; i < count; ++i) { if (readConstantPoolEntry(di, i)) { // double slot ++i; } } }
public void readFrom(DataInput in) throws Exception { type=in.readByte(); seqno=Bits.readLong(in); num_seqnos=in.readUnsignedShort(); }
/** * Reads a UTF format String from the DataInput Stream <code>in</code>. * * @param in * the input stream to read from * @return the next UTF String from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ public static final String readUTF(DataInput in) throws IOException { return decodeUTF(in.readUnsignedShort(), in); }
/** Skips over one UTF8 in the input. */ public static void skip(DataInput in) throws IOException { int length = in.readUnsignedShort(); WritableUtils.skipFully(in, length); }
public void testReadUnsignedShort_eof() throws IOException { byte[] buf = {23}; DataInput in = new LittleEndianDataInputStream(new ByteArrayInputStream(buf)); try { in.readUnsignedShort(); fail(); } catch (EOFException expected) { } }
private String readAnnotation(final DataInput di) throws IOException { final String rawTypeName = resolveUtf8(di); // num_element_value_pairs final int count = di.readUnsignedShort(); print("annotation elements count: %d", count); for (int i = 0; i < count; ++i) { if (logger.isDebugEnabled()) { print("element '%s'", resolveUtf8(di)); } else { di.skipBytes(2); } readAnnotationElementValue(di); } return rawTypeName; }
public void testReadLittleEndian() throws IOException { DataInput in = new LittleEndianDataInputStream(new ByteArrayInputStream(data)); /* Read in various values in LITTLE ENDIAN FORMAT */ byte[] b = new byte[2]; in.readFully(b); assertEquals(-100, b[0]); assertEquals(100, b[1]); assertEquals(true, in.readBoolean()); assertEquals(false, in.readBoolean()); assertEquals(100, in.readByte()); assertEquals(-100, in.readByte()); assertEquals(200, in.readUnsignedByte()); assertEquals('\u6100', in.readChar()); assertEquals(-12150, in.readShort()); assertEquals(20675, in.readUnsignedShort()); assertEquals(0xBEBAFECA, in.readInt()); assertEquals(0xBEBAFECAEFBEADDEL, in.readLong()); assertEquals("Herby Derby", in.readUTF()); assertEquals(0xBEBAFECA, Float.floatToIntBits(in.readFloat())); assertEquals(0xBEBAFECAEFBEADDEL, Double.doubleToLongBits(in.readDouble())); }
private void readFields(final DataInput di) throws IOException { final int count = di.readUnsignedShort(); print("field count = %d", count); for (int i = 0; i < count; ++i) { readAccessFlags(di); memberName = resolveUtf8(di); final String descriptor = resolveUtf8(di); readAttributes(di, 'F', fieldReporter == null); print("Field: %s, descriptor: %s", memberName, descriptor); } }
private void readMethods(final DataInput di) throws IOException { final int count = di.readUnsignedShort(); { print("method count = %d", count); } for (int i = 0; i < count; ++i) { readAccessFlags(di); memberName = resolveUtf8(di); final String descriptor = resolveUtf8(di); readAttributes(di, 'M', methodReporter == null); print("Method: %s, descriptor: %s", memberName, descriptor); } }
assertEquals('\u6100', in.readChar()); assertEquals(-12150, in.readShort()); assertEquals(20675, in.readUnsignedShort()); assertEquals(0xBEBAFECA, in.readInt()); assertEquals(0xBEBAFECAEFBEADDEL, in.readLong());