/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ @Override public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
/** @see java.io.DataInput#readShort() */ public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
@Test public void testReadSwappedShort() throws IOException { final byte[] bytes = new byte[] { 0x02, 0x01 }; assertEquals( 0x0102, EndianUtils.readSwappedShort( bytes, 0 ) ); final ByteArrayInputStream input = new ByteArrayInputStream(bytes); assertEquals( 0x0102, EndianUtils.readSwappedShort( input ) ); }
/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ @Override public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
/** * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}. * @return the read long * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */ public short readShort() throws IOException, EOFException { return EndianUtils.readSwappedShort( in ); }
public short readShort() throws IOException { return EndianUtils.readSwappedShort(this); }
public static DBFHeader read(final DataInputStream dataInput) throws IOException { final DBFHeader header = new DBFHeader(); header.signature = dataInput.readByte(); /* 0 */ header.year = dataInput.readByte(); /* 1 */ header.month = dataInput.readByte(); /* 2 */ header.day = dataInput.readByte(); /* 3 */ header.numberOfRecords = EndianUtils.readSwappedInteger(dataInput); //DbfUtils.readLittleEndianInt(dataInput); /* 4-7 */ header.headerLength = EndianUtils.readSwappedShort(dataInput);//DbfUtils.readLittleEndianShort(dataInput); /* 8-9 */ header.recordLength = EndianUtils.readSwappedShort(dataInput);//DbfUtils.readLittleEndianShort(dataInput); /* 10-11 */ header.reserved1 = dataInput.readShort();//DbfUtils.readLittleEndianShort(dataInput); /* 12-13 */ header.incompleteTransaction = dataInput.readByte(); /* 14 */ header.encryptionFlag = dataInput.readByte(); /* 15 */ header.freeRecordThread = dataInput.readInt();//DbfUtils.readLittleEndianInt(dataInput); /* 16-19 */ header.reserved2 = dataInput.readInt(); /* 20-23 */ header.reserved3 = dataInput.readInt(); /* 24-27 */ header.mdxFlag = dataInput.readByte(); /* 28 */ header.languageDriver = dataInput.readByte(); /* 29 */ header.reserved4 = dataInput.readShort();//DbfUtils.readLittleEndianShort(dataInput); /* 30-31 */ header.fields = new ArrayList<DBFField>(); DBFField field; while ((field = DBFField.read(dataInput)) != null) { header.fields.add(field); } header.numberOfFields = header.fields.size(); return header; }