Package org.biojava.utils.io
Class LargeBuffer
- java.lang.Object
-
- org.biojava.utils.io.LargeBuffer
-
public class LargeBuffer extends Object
Wrapper arround MappedByteBuffers to allow long-indexed access to files larger than 2 gigs.- Author:
- Matthews Pocock
-
-
Constructor Summary
Constructors Constructor Description LargeBuffer(FileChannel channel, FileChannel.MapMode mode, long pos, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforce()byteget()byteget(long pos)chargetChar()chargetChar(long pos)doublegetDouble()doublegetDouble(long pos)floatgetFloat()floatgetFloat(long pos)intgetInt()intgetInt(long pos)longgetLong()longgetLong(long pos)shortgetShort()shortgetShort(long pos)longposition()voidposition(long pos)voidput(byte val)voidput(long pos, byte b)voidputChar(char val)voidputChar(long pos, char c)voidputDouble(double val)voidputDouble(long pos, double d)voidputFloat(float val)voidputFloat(long pos, float f)voidputInt(int val)voidputInt(long pos, int i)voidputLong(long val)voidputLong(long pos, long l)voidputShort(long pos, short s)voidputShort(short val)
-
-
-
Constructor Detail
-
LargeBuffer
public LargeBuffer(FileChannel channel, FileChannel.MapMode mode, long pos, long size) throws IOException
- Throws:
IOException
-
-
Method Detail
-
get
public byte get(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
get
public byte get() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
put
public void put(long pos, byte b) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
put
public void put(byte val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getChar
public char getChar(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getChar
public char getChar() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putChar
public void putChar(long pos, char c) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putChar
public void putChar(char val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getDouble
public double getDouble(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getDouble
public double getDouble() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putDouble
public void putDouble(long pos, double d) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putDouble
public void putDouble(double val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getFloat
public float getFloat(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getFloat
public float getFloat() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putFloat
public void putFloat(long pos, float f) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putFloat
public void putFloat(float val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getInt
public int getInt(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getInt
public int getInt() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putInt
public void putInt(long pos, int i) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putInt
public void putInt(int val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getLong
public long getLong(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getLong
public long getLong() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putLong
public void putLong(long pos, long l) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putLong
public void putLong(long val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getShort
public short getShort(long pos) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
getShort
public short getShort() throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putShort
public void putShort(long pos, short s) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
putShort
public void putShort(short val) throws IndexOutOfBoundsException, IOException
- Throws:
IndexOutOfBoundsExceptionIOException
-
position
public long position()
-
position
public void position(long pos)
-
force
public void force()
-
-