|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.fits.AbstractArrayDataIO
uk.ac.starlink.fits.MultiMappedFile
public class MultiMappedFile
ArrayDataIO implementation which works by mapping but is capable of splitting a file up into multiple mapped sections. This will be necessary if it's larger than Integer.MAX_VALUE bytes, though note that doing this is only going to be a good idea on a 64-bit OS.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
close()
|
CopyableRandomAccess |
copyAccess()
Returns a new copy of this object. |
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. |
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 |
seek(long offsetFromStart)
|
long |
skip(long nskip)
|
int |
skipBytes(int toSkip)
|
Methods inherited from class uk.ac.starlink.fits.AbstractArrayDataIO |
---|
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, 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, writeUTF |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nom.tam.util.ArrayDataInput |
---|
read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readArray |
Methods inherited from interface java.io.DataInput |
---|
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF |
Constructor Detail |
---|
public 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.IOException
public 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.IOException
Method Detail |
---|
public CopyableRandomAccess copyAccess() throws java.io.IOException
CopyableRandomAccess
copyAccess
in interface CopyableRandomAccess
java.io.IOException
public void seek(long offsetFromStart) throws java.io.IOException
seek
in interface nom.tam.util.RandomAccess
java.io.IOException
public long skip(long nskip) throws java.io.IOException
skip
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public long getFilePointer()
getFilePointer
in interface nom.tam.util.RandomAccess
public int skipBytes(int toSkip) throws java.io.IOException
skipBytes
in interface java.io.DataInput
java.io.IOException
protected byte get() throws java.io.IOException
AbstractArrayDataIO
get
in class AbstractArrayDataIO
java.io.IOException
protected void get(byte[] buf, int offset, int length) throws java.io.IOException
AbstractArrayDataIO
get
in class AbstractArrayDataIO
buf
- destination bufferoffset
- offset of first byte in buf
to be writtenlength
- maximum number of bytes to be written to
buf
java.io.IOException
protected void put(byte b) throws java.io.IOException
AbstractArrayDataIO
put
in class AbstractArrayDataIO
b
- output byte
java.io.IOException
protected void put(byte[] buf, int offset, int length) throws java.io.IOException
AbstractArrayDataIO
put
in class AbstractArrayDataIO
buf
- source bufferoffset
- offset of first byte in buf
to be readlength
- number of bytes from buf
to be read
java.io.IOException
public long length()
AbstractArrayDataIO
length
in class AbstractArrayDataIO
protected long remaining()
AbstractArrayDataIO
Long.MAX_VALUE
;
remaining
in class AbstractArrayDataIO
public void close() throws java.io.IOException
close
in interface nom.tam.util.ArrayDataInput
close
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void flush()
flush
in interface nom.tam.util.ArrayDataOutput
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |