/** {@inheritDoc} */ public short readShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (short) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (short) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public int readUnsignedShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (buffer[position] & 0xff) << 8 | (buffer[position + 1] & 0xff); } }
/** {@inheritDoc} */ public char readChar() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (char) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (char) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public int readUnsignedByte() throws IOException { return readUnsignedByteDirect(); }
/** * Read an int value. * * @return the value * @throws IOException if an error occurs */ protected int readIntDirect() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 4) { return readUnsignedByteDirect() << 24 | readUnsignedByteDirect() << 16 | readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 4; return buffer[position] << 24 | (buffer[position + 1] & 0xff) << 16 | (buffer[position + 2] & 0xff) << 8 | (buffer[position + 3] & 0xff); } }
/** {@inheritDoc} */ public short readShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (short) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (short) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public int readUnsignedShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (buffer[position] & 0xff) << 8 | (buffer[position + 1] & 0xff); } }
/** {@inheritDoc} */ public short readShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (short) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (short) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public int readUnsignedShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (buffer[position] & 0xff) << 8 | (buffer[position + 1] & 0xff); } }
/** {@inheritDoc} */ public int readUnsignedShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (buffer[position] & 0xff) << 8 | (buffer[position + 1] & 0xff); } }
/** {@inheritDoc} */ public char readChar() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (char) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (char) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public short readShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (short) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (short) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public char readChar() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (char) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (char) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public char readChar() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (char) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (char) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public short readShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (short) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (short) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public int readUnsignedShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (buffer[position] & 0xff) << 8 | (buffer[position + 1] & 0xff); } }
/** {@inheritDoc} */ public char readChar() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (char) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (char) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public char readChar() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (char) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (char) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public short readShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return (short) (readUnsignedByteDirect() << 8 | readUnsignedByteDirect()); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (short) (buffer[position] << 8 | (buffer[position + 1] & 0xff)); } }
/** {@inheritDoc} */ public int readUnsignedShort() throws IOException { int position = this.position; int remaining = limit - position; if (remaining < 2) { return readUnsignedByteDirect() << 8 | readUnsignedByteDirect(); } else { final byte[] buffer = this.buffer; this.position = position + 2; return (buffer[position] & 0xff) << 8 | (buffer[position + 1] & 0xff); } }