protected long getLong(int index) { return ((long) data.get(index + 7) << 56) + ((long) data.get(index + 6) << 48) + ((long) data.get(index + 5) << 40) + ((long) data.get(index + 4) << 32) + ((long) data.get(index + 3) << 24) + ((long) data.get(index + 2) << 16) + ((long) data.get(index + 1) << 8) + ((long) data.get(index) << 0); } }
protected long getLong(int index) { return ((long) data.get(index + 7) << 56) + ((long) data.get(index + 6) << 48) + ((long) data.get(index + 5) << 40) + ((long) data.get(index + 4) << 32) + ((long) data.get(index + 3) << 24) + ((long) data.get(index + 2) << 16) + ((long) data.get(index + 1) << 8) + ((long) data.get(index) << 0); } }
protected long getLong(int index) { return ((long) data.get(index) << 56) + ((long) data.get(index + 1) << 48) + ((long) data.get(index + 2) << 40) + ((long) data.get(index + 3) << 32) + ((long) data.get(index + 4) << 24) + ((long) data.get(index + 5) << 16) + ((long) data.get(index + 6) << 8) + ((long) data.get(index + 7) << 0); } }
/** * Get a byte, should be equal for all endians * * @return the byte value */ public byte getByte() { return (byte) data.get(position++); }
protected long getLong(int index) { return ((long) data.get(index) << 56) + ((long) data.get(index + 1) << 48) + ((long) data.get(index + 2) << 40) + ((long) data.get(index + 3) << 32) + ((long) data.get(index + 4) << 24) + ((long) data.get(index + 5) << 16) + ((long) data.get(index + 6) << 8) + ((long) data.get(index + 7) << 0); } }
/** * Get a byte, should be equal for all endians * * @return the byte value */ public byte getByte() { return (byte) data.get(position++); }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes The appropriate Byte Getter * * @return the ValueGetter */ public static ValueGetter valueGetterForEndian(ByteGetter bytes) { if (bytes.get(0) == ValueGetter.XDR.NUMBER) { // XDR return new ValueGetter.XDR(bytes); } else if (bytes.get(0) == ValueGetter.NDR.NUMBER) { return new ValueGetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + bytes.get(0)); } }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes The appropriate Byte Getter * * @return the ValueGetter */ public static ValueGetter valueGetterForEndian(ByteGetter bytes) { if (bytes.get(0) == ValueGetter.XDR.NUMBER) { // XDR return new ValueGetter.XDR(bytes); } else if (bytes.get(0) == ValueGetter.NDR.NUMBER) { return new ValueGetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + bytes.get(0)); } }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes The appropriate Byte Getter * * @return the ValueGetter */ public static ValueGetter valueGetterForEndian(ByteGetter bytes) { if (bytes.get(0) == ValueGetter.XDR.NUMBER) { // XDR return new ValueGetter.XDR(bytes); } else if (bytes.get(0) == ValueGetter.NDR.NUMBER) { return new ValueGetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + bytes.get(0)); } }
/** * Get the appropriate ValueGetter for my endianness * * @param bytes * The appropriate Byte Getter * * @return the ValueGetter */ public static ValueGetter valueGetterForEndian(ByteGetter bytes) { if (bytes.get(0) == ValueGetter.XDR.NUMBER) { // XDR return new ValueGetter.XDR(bytes); } else if (bytes.get(0) == ValueGetter.NDR.NUMBER) { return new ValueGetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + bytes.get(0)); } }
/** * Return the {@link org.postgis.binary.ValueGetter} for the endian from the given * {@link org.postgis.binary.ByteGetter}. * * @param bytes {@link org.postgis.binary.ByteGetter} to read. * * @return The {@link org.postgis.binary.ValueGetter} for the endian */ public static ValueGetter valueGetterForEndian(ByteGetter bytes) { if (bytes.get(0) == 0) { return new ValueGetter.XDR(bytes); } else if (bytes.get(0) == 1) { return new ValueGetter.NDR(bytes); } else { throw new IllegalArgumentException("Unknown Endian type:" + bytes.get(0)); } }