public class MultiMappedFile extends AbstractArrayDataIO implements nom.tam.util.RandomAccess
BITS_OF_1_BYTE, BITS_OF_2_BYTES, BITS_OF_3_BYTES, BITS_OF_4_BYTES, BITS_OF_5_BYTES, BITS_OF_6_BYTES, BITS_OF_7_BYTES, BYTE_1_OF_LONG_MASK, BYTE_2_OF_LONG_MASK, BYTE_3_OF_LONG_MASK, BYTE_4_OF_LONG_MASK, BYTE_MASK, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_FLOAT, BYTES_IN_INTEGER, BYTES_IN_LONG, BYTES_IN_SHORT, DEFAULT_BUFFER_SIZE, HIGH_INTEGER_MASK, INTEGER_MASK, SHORT_MASK, SHORT_OF_LONG_MASK| Constructor and Description |
|---|
MultiMappedFile(java.nio.channels.FileChannel chan,
java.nio.channels.FileChannel.MapMode mode,
int blockBytes)
Constructs a MultiMappedFile from a channel.
|
MultiMappedFile(java.io.File file,
java.nio.channels.FileChannel.MapMode mode,
int blockBytes)
Constructs a MultiMappedFile from a file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
protected byte |
get()
Reads one byte from the current position.
|
protected void |
get(byte[] buf,
int offset,
int length)
Reads bytes into a buffer from the current position.
|
long |
getFilePointer() |
long |
length()
Returns the size of this buffer.
|
void |
mark(int i) |
boolean |
markSupported() |
protected void |
put(byte b)
Writes a single byte at the current position.
|
protected void |
put(byte[] buf,
int offset,
int length)
Writes bytes from a buffer to the current position.
|
protected long |
remaining()
Returns the number of bytes remaining between the current position
and the end of the file.
|
void |
reset() |
void |
seek(long offsetFromStart) |
long |
skip(long nskip) |
void |
skipAllBytes(int toSkip) |
void |
skipAllBytes(long toSkip) |
int |
skipBytes(int toSkip) |
read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readArray, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLArray, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeArray, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic MultiMappedFile(java.nio.channels.FileChannel chan,
java.nio.channels.FileChannel.MapMode mode,
int blockBytes)
throws java.io.IOException
chan - file channelmode - mapping modeblockBytes - number of bytes per mapped block
(though the final one may have fewer)java.io.IOExceptionpublic MultiMappedFile(java.io.File file,
java.nio.channels.FileChannel.MapMode mode,
int blockBytes)
throws java.io.IOException
file - filemode - mapping modeblockBytes - number of bytes per mapped block
(though the final one may have fewer)java.io.IOExceptionpublic void seek(long offsetFromStart)
throws java.io.IOException
seek in interface nom.tam.util.RandomAccessjava.io.IOExceptionpublic long skip(long nskip)
throws java.io.IOException
skip in interface nom.tam.util.ArrayDataInputjava.io.IOExceptionpublic long getFilePointer()
getFilePointer in interface nom.tam.util.RandomAccesspublic void skipAllBytes(long toSkip)
throws java.io.IOException
skipAllBytes in interface nom.tam.util.ArrayDataInputjava.io.IOExceptionpublic void skipAllBytes(int toSkip)
throws java.io.IOException
skipAllBytes in interface nom.tam.util.ArrayDataInputjava.io.IOExceptionpublic int skipBytes(int toSkip)
throws java.io.IOException
skipBytes in interface java.io.DataInputjava.io.IOExceptionprotected byte get()
throws java.io.IOException
AbstractArrayDataIOget in class AbstractArrayDataIOjava.io.IOExceptionprotected void get(byte[] buf,
int offset,
int length)
throws java.io.IOException
AbstractArrayDataIOget in class AbstractArrayDataIObuf - destination bufferoffset - offset of first byte in buf to be writtenlength - maximum number of bytes to be written to
bufjava.io.IOExceptionprotected void put(byte b)
throws java.io.IOException
AbstractArrayDataIOput in class AbstractArrayDataIOb - output bytejava.io.IOExceptionprotected void put(byte[] buf,
int offset,
int length)
throws java.io.IOException
AbstractArrayDataIOput in class AbstractArrayDataIObuf - source bufferoffset - offset of first byte in buf to be readlength - number of bytes from buf to be readjava.io.IOExceptionpublic long length()
AbstractArrayDataIOlength in class AbstractArrayDataIOprotected long remaining()
AbstractArrayDataIOLong.MAX_VALUE;remaining in class AbstractArrayDataIOpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface nom.tam.util.FitsIOjava.io.IOExceptionpublic void flush()
flush in interface nom.tam.util.ArrayDataOutputpublic boolean markSupported()
public void reset()
throws java.io.IOException
reset in interface nom.tam.util.ArrayDataInputjava.io.IOExceptionpublic void mark(int i)
mark in interface nom.tam.util.ArrayDataInputCopyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.