/** * Returns the request's port number. */ public int getPort() { return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN); }
public short readShort() { short result = Memory.peekShort(buffer, offset + position, order); position += SizeOf.SHORT; return result; }
public short readShort() { short result = Memory.peekShort(address + position, swap); position += SizeOf.SHORT; return result; } }
private int peekShort(int offset) { return Memory.peekShort(hdrBuf, offset, ByteOrder.LITTLE_ENDIAN) & 0xffff; }
public final short peekShort(int offset, ByteOrder order) { return Memory.peekShort(address + offset, order.needsSwap); }
/** * Reads a big-endian 16-bit short 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 short 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 #writeShort(int) */ public final short readShort() throws IOException { readFully(scratch, 0, SizeOf.SHORT); return Memory.peekShort(scratch, 0, ByteOrder.BIG_ENDIAN); }
@Override public final char getChar(int index) { checkIndex(index, SizeOf.CHAR); return (char) Memory.peekShort(backingArray, arrayOffset + index, order); }
public final short readShort() throws IOException { Streams.readFully(in, scratch, 0, SizeOf.SHORT); return Memory.peekShort(scratch, 0, ByteOrder.BIG_ENDIAN); }
@Override public final char getChar() { int newPosition = position + SizeOf.CHAR; if (newPosition > limit) { throw new BufferUnderflowException(); } char result = (char) Memory.peekShort(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final short getShort() { int newPosition = position + SizeOf.SHORT; if (newPosition > limit) { throw new BufferUnderflowException(); } short result = Memory.peekShort(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final short getShort(int index) { checkIndex(index, SizeOf.SHORT); return Memory.peekShort(backingArray, arrayOffset + index, order); }
byte[] header = new byte[10]; readFully(header, 0, header.length); short magic = Memory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN); if (magic != (short) GZIP_MAGIC) { throw new IOException(String.format("unknown format (magic number %x)", magic)); crc.update(header, 0, 2); int length = Memory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN) & 0xffff; while (length > 0) { int max = length > buf.length ? buf.length : length; short crc16 = Memory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN); if ((short) crc.getValue() != crc16) { throw new IOException("CRC mismatch");
/** * Returns the request's port number. */ public int getPort() { return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN); }
/** * Returns the request's port number. */ public int getPort() { return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN); }
public short readShort() { short result = Memory.peekShort(buffer, offset + position, order); position += SizeOf.SHORT; return result; }
/** * Returns the request's port number. */ public int getPort() { return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN); }
@Override public final short getShort() { int newPosition = position + SizeOf.SHORT; if (newPosition > limit) { throw new BufferUnderflowException(); } short result = Memory.peekShort(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final short getShort() { int newPosition = position + SizeOf.SHORT; if (newPosition > limit) { throw new BufferUnderflowException(); } short result = Memory.peekShort(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final short getShort() { int newPosition = position + SizeOf.SHORT; if (newPosition > limit) { throw new BufferUnderflowException(); } short result = Memory.peekShort(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final char getChar() { int newPosition = position + SizeOf.CHAR; if (newPosition > limit) { throw new BufferUnderflowException(); } char result = (char) Memory.peekShort(backingArray, arrayOffset + position, order); position = newPosition; return result; }