/** * Reads and returns a single long value from the buffer. The equivalent of called {@link #readLong(byte[], int)} with an offset of * zero. * * @param buffer the buffer to read from * @return the long value */ public static long readLong(final byte[] buffer) { return readLong(buffer, 0); }
/** * Reads and returns a single long value from the input stream. * * @param inputStream the input stream to read from * @return the long value * @throws IOException if there's an error reading from the {@code inputStream} */ public static long readLong(final InputStream inputStream) throws IOException { return readLong(inputStream, new byte[8]); }
/** * Reads and returns a single long value from the input stream. * * @param inputStream the input stream to read from * @param buffer the buffer to write the input stream bytes into * @return the long value * @throws IOException if there's an error reading from the {@code inputStream} */ public static long readLong(final InputStream inputStream, final byte[] buffer) throws IOException { readFully(inputStream, buffer, 8); return readLong(buffer); }
@Override protected void doWriteBinaryData(final BsonBinary value) { if (value.getType() == BsonBinarySubType.UUID_LEGACY.getValue()) { bsonCallback.gotUUID(getName(), readLong(value.getData(), 0), readLong(value.getData(), 8)); } else { bsonCallback.gotBinary(getName(), value.getType(), value.getData()); } }
public static long readLong( InputStream in ) throws IOException { return readLong( in , new byte[8] ); }
public static long readLong( byte[] data ) { return readLong( data , 0 ); }
public static long readLong( InputStream in , byte[] data ) throws IOException { readFully(in, data, 8); return readLong(data); }
public long readLong() throws IOException { return org.bson.io.Bits.readLong( _inputBuffer , _need(8) ); }
static final long readInt64(ChannelBuffer buffer, byte[] eightBytes) { buffer.readBytes(eightBytes); return Bits.readLong(eightBytes); }