/** * Reads a big-endian 16-bit character from the current position in this file. Blocks until * two bytes have been read, the end of the file is reached or an exception is * thrown. * * @return the next char value from this file. * @throws EOFException * if the end of this file is detected. * @throws IOException * if this file is closed or another I/O error occurs. * @see #writeChar(int) */ public final char readChar() throws IOException { return (char) readShort(); }
/** * Reads an unsigned big-endian 16-bit short from the current position in this file and * returns it as an integer. Blocks until two bytes have been read, the end of * the file is reached or an exception is thrown. * * @return the next unsigned short value from this file as an int. * @throws EOFException * if the end of this file is detected. * @throws IOException * if this file is closed or another I/O error occurs. * @see #writeShort(int) */ public final int readUnsignedShort() throws IOException { return ((int) readShort()) & 0xffff; }
@Override public short readShort(int offset) { checkRead(offset, SHORT); try { seekToOffset(offset); return randomAccessFile.readShort(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public short readShort() throws IOException { try { return getRaf().readShort(); } catch (IOException ioe) { handleException(); throw ioe; } }
/** * Read a signed short. * * @return An signed short. * @throws IOException If there is an error reading the data. * @see RandomAccessFile#readShort() */ @Override public short readSignedShort() throws IOException { return raf.readShort(); }
public short readShort() throws IOException { return delegate.readShort(); } public int readUnsignedByte() throws IOException { return delegate.readUnsignedByte(); }
return raf.readByte(); } else if (binding == Short.class || binding == short.class) { return raf.readShort(); } else if (binding == Integer.class || binding == int.class) { return raf.readInt();
/** * Read a signed short. * * @return An signed short. * @throws IOException If there is an error reading the data. * @see RandomAccessFile#readShort() */ @Override public short readSignedShort() throws IOException { return raf.readShort(); }
@Override public short readShort() throws IOException { return raf.readShort(); }
/** * Read an signed short. * * @return An signed short. * @throws IOException If there is an error reading the data. */ public short readSignedShort() throws IOException { return raf.readShort(); }
@Override public short processCall(int register, short data) { writeWordData(register, data); try { return deviceFile.readShort(); } catch (IOException e) { throw new RuntimeIOException("Error in I2C processCall for device i2c-" + controller + "-0x" + Integer.toHexString(deviceAddress), e); } }
@Override public short readShort(long offset) { checkRead(offset, SHORT); try { seekToOffset(offset); return randomAccessFile.readShort(); } catch (IOException e) { throw new RuntimeException(e); } }
protected genAmountType(RandomAccessFile file) throws IOException { ranges = new rangesType(file); shAmount = file.readShort(); wAmount = ConversionUtils.readUnsignedShort(file); } }
@Override public short readShort() throws IOException { try { return getRaf().readShort(); } catch (IOException ioe) { handleException(); throw ioe; } }
@Override public short readShort() throws IOException { try { return getRaf().readShort(); } catch (IOException ioe) { handleException(); throw ioe; } }
@Override public short readShort() throws IOException { try { return getRaf().readShort(); } catch (IOException ioe) { handleException(); throw ioe; } }
protected sfModList(RandomAccessFile file) throws IOException { sfModSrcOper = new SFModulator(file); sfModDestOper = new SFGenerator(file); modAmount = file.readShort(); sfModAmtSrcOper = new SFModulator(file); sfModTransOper = new SFTransform(file); }
@Test(expected = FileReactiveAuditException.class) public void readShort() throws IOException { ReactiveAudit.off.commit(); try (RandomAccessFile rw = newRandomAccessFile()) { TestTools.strict.commit(); rw.readShort(); } }