@Override public final char readChar() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 16-bit <code>short</code> value from this stream. * * @return the next <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final short readShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (short) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
@Override public final char readChar() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 32-bit integer value from this stream. * * @return the next <code>int</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final int readInt() throws IOException { if (readToBuff(4) < 0) { throw new EOFException(); } return ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); }
/** * Reads a 16-bit unsigned <code>short</code> value from this stream and * returns it as an int. * * @return the next unsigned <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final int readUnsignedShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 64-bit <code>long</code> value from this stream. * * @return the next <code>long</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final long readLong() throws IOException { if (readToBuff(8) < 0) { throw new EOFException(); } int i1 = ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); int i2 = ((buff[4] & 0xff) << 24) | ((buff[5] & 0xff) << 16) | ((buff[6] & 0xff) << 8) | (buff[7] & 0xff); return ((i1 & 0xffffffffL) << 32) | (i2 & 0xffffffffL); }
/** * Reads a 16-bit unsigned <code>short</code> value from this stream and * returns it as an int. * * @return the next unsigned <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final int readUnsignedShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 64-bit <code>long</code> value from this stream. * * @return the next <code>long</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final long readLong() throws IOException { if (readToBuff(8) < 0) { throw new EOFException(); } int i1 = ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); int i2 = ((buff[4] & 0xff) << 24) | ((buff[5] & 0xff) << 16) | ((buff[6] & 0xff) << 8) | (buff[7] & 0xff); return ((i1 & 0xffffffffL) << 32) | (i2 & 0xffffffffL); }
/** * Reads a 16-bit <code>short</code> value from this stream. * * @return the next <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final short readShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (short) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 32-bit integer value from this stream. * * @return the next <code>int</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final int readInt() throws IOException { if (readToBuff(4) < 0) { throw new EOFException(); } return ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); }
@Override public final char readChar() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
public final char readChar() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 16-bit <code>short</code> value from this stream. * * @return the next <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ public final short readShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (short) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 32-bit integer value from this stream. * * @return the next <code>int</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ public final int readInt() throws IOException { if (readToBuff(4) < 0) { throw new EOFException(); } return ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); }
/** * Reads a 16-bit unsigned <code>short</code> value from this stream and * returns it as an int. * * @return the next unsigned <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ public final int readUnsignedShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 16-bit <code>short</code> value from this stream. * * @return the next <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final short readShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (short) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 32-bit integer value from this stream. * * @return the next <code>int</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final int readInt() throws IOException { if (readToBuff(4) < 0) { throw new EOFException(); } return ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); }
/** * Reads a 16-bit unsigned <code>short</code> value from this stream and * returns it as an int. * * @return the next unsigned <code>short</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final int readUnsignedShort() throws IOException { if (readToBuff(2) < 0) { throw new EOFException(); } return (char) (((buff[0] & 0xff) << 8) | (buff[1] & 0xff)); }
/** * Reads a 64-bit <code>long</code> value from this stream. * * @return the next <code>long</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ public final long readLong() throws IOException { if (readToBuff(8) < 0) { throw new EOFException(); } int i1 = ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); int i2 = ((buff[4] & 0xff) << 24) | ((buff[5] & 0xff) << 16) | ((buff[6] & 0xff) << 8) | (buff[7] & 0xff); return ((i1 & 0xffffffffL) << 32) | (i2 & 0xffffffffL); }
/** * Reads a 64-bit <code>long</code> value from this stream. * * @return the next <code>long</code> value from the source stream. * * @throws IOException * If a problem occurs reading from this DataInputStream. * */ @Override public final long readLong() throws IOException { if (readToBuff(8) < 0) { throw new EOFException(); } int i1 = ((buff[0] & 0xff) << 24) | ((buff[1] & 0xff) << 16) | ((buff[2] & 0xff) << 8) | (buff[3] & 0xff); int i2 = ((buff[4] & 0xff) << 24) | ((buff[5] & 0xff) << 16) | ((buff[6] & 0xff) << 8) | (buff[7] & 0xff); return ((i1 & 0xffffffffL) << 32) | (i2 & 0xffffffffL); }