Package ucar.unidata.io
Class MMapRandomAccessFile
- java.lang.Object
-
- ucar.unidata.io.RandomAccessFile
-
- ucar.unidata.io.MMapRandomAccessFile
-
- All Implemented Interfaces:
Closeable
,DataInput
,DataOutput
,AutoCloseable
,FileCacheable
@Deprecated public class MMapRandomAccessFile extends RandomAccessFile
Deprecated.not part of public API.Use NIO MappedByteBuffer to implement a RandomAccessFile. Limited to 2G size. Not currently used - NOT UP TO DATE DO NOT USE
-
-
Field Summary
-
Fields inherited from class ucar.unidata.io.RandomAccessFile
allFiles, BIG_ENDIAN, bigEndian, buffer, bufferModified, bufferStart, dataEnd, dataSize, debugAccess, debugLeaks, defaultBufferSize, endOfFile, file, fileChannel, filePosition, LITTLE_ENDIAN, location, openFiles, readonly, showOpen, showRead
-
-
Constructor Summary
Constructors Constructor Description MMapRandomAccessFile(String location, String mode)
Deprecated.Constructor for in-memory "files"
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
flush()
Deprecated.Copy the contents of the buffer to the disk.long
length()
Deprecated.Get the length of the file.int
read()
Deprecated.Read a byte of data from the file, blocking until data is available.int
readBytes(byte[] dst, int offset, int length)
Deprecated.Read up tolen
bytes into an array, at a specified offset.void
seek(long pos)
Deprecated.Set the position in the file for the next read or write.void
unread()
Deprecated.Unread the last byte read.void
write(int b)
Deprecated.Write a byte to the file.void
writeBytes(byte[] dst, int offset, int length)
Deprecated.Writelen
bytes from an array to the file.-
Methods inherited from class ucar.unidata.io.RandomAccessFile
acquire, acquire, close, eject, enableDefaultGlobalFileCache, getAllFiles, getBufferSize, getDebugLeaks, getDebugNbytes, getDebugNseeks, getFilePointer, getGlobalFileCache, getLastModified, getLocation, getMaxOpenFileCount, getOpenFileCount, getOpenFiles, getRandomAccessFile, isAtEndOfFile, isDirectory, order, order, reacquire, read, read, read_, readBoolean, readBuffer, readByte, readBytes, readChar, readDouble, readDouble, readFloat, readFloat, readFully, readFully, readInt, readInt, readIntUnbuffered, readLine, readLine, readLong, readLong, readShort, readShort, readString, readString, readStringMax, readStringMax, readToByteChannel, readUnsignedByte, readUnsignedShort, readUTF, release, searchForward, setBufferSize, setDebugAccess, setDebugLeaks, setExtendMode, setFileCache, setGlobalFileCache, setMinLength, shutdown, skipBytes, skipBytes, toString, write, write, writeBoolean, writeBoolean, writeByte, writeBytes, writeBytes, writeChar, writeChar, writeChar, writeChar, writeChar, writeChar, writeChars, writeChars, writeChars, writeDouble, writeDouble, writeDouble, writeDouble, writeDouble, writeDouble, writeFloat, writeFloat, writeFloat, writeFloat, writeFloat, writeFloat, writeInt, writeInt, writeInt, writeInt, writeInt, writeInt, writeLong, writeLong, writeLong, writeLong, writeLong, writeLong, writeShort, writeShort, writeShort, writeShort, writeShort, writeShort, writeUTF
-
-
-
-
Constructor Detail
-
MMapRandomAccessFile
public MMapRandomAccessFile(String location, String mode) throws IOException
Deprecated.Constructor for in-memory "files"- Parameters:
location
- used as a namemode
- the open mode- Throws:
IOException
- on error
-
-
Method Detail
-
flush
public void flush()
Deprecated.Description copied from class:RandomAccessFile
Copy the contents of the buffer to the disk.- Overrides:
flush
in classRandomAccessFile
-
length
public long length()
Deprecated.Description copied from class:RandomAccessFile
Get the length of the file. The data in the buffer (which may not have been written the disk yet) is taken into account.- Overrides:
length
in classRandomAccessFile
- Returns:
- the length of the file in bytes.
-
seek
public void seek(long pos)
Deprecated.Description copied from class:RandomAccessFile
Set the position in the file for the next read or write.- Overrides:
seek
in classRandomAccessFile
- Parameters:
pos
- the offset (in bytes) from the start of the file.
-
unread
public void unread()
Deprecated.Description copied from class:RandomAccessFile
Unread the last byte read. This method should not be used more than once between reading operations, or strange things might happen.- Overrides:
unread
in classRandomAccessFile
-
read
public int read()
Deprecated.Description copied from class:RandomAccessFile
Read a byte of data from the file, blocking until data is available.- Overrides:
read
in classRandomAccessFile
- Returns:
- the next byte of data, or -1 if the end of the file is reached.
-
readBytes
public int readBytes(byte[] dst, int offset, int length)
Deprecated.Description copied from class:RandomAccessFile
Read up tolen
bytes into an array, at a specified offset. This will block until at least one byte has been read.- Overrides:
readBytes
in classRandomAccessFile
- Parameters:
dst
- the byte array to receive the bytes.offset
- the offset in the array where copying will start.length
- the number of bytes to copy.- Returns:
- the actual number of bytes read, or -1 if there is not more data due to the end of the file being reached.
-
write
public void write(int b)
Deprecated.Description copied from class:RandomAccessFile
Write a byte to the file. If the file has not been opened for writing, an IOException will be raised only when an attempt is made to write the buffer to the file. Caveat: the effects of seek( )ing beyond the end of the file are undefined.- Specified by:
write
in interfaceDataOutput
- Overrides:
write
in classRandomAccessFile
- Parameters:
b
- write this byte
-
writeBytes
public void writeBytes(byte[] dst, int offset, int length)
Deprecated.Description copied from class:RandomAccessFile
Writelen
bytes from an array to the file.- Overrides:
writeBytes
in classRandomAccessFile
- Parameters:
dst
- the array containing the data.offset
- the offset in the array to the data.length
- the length of the data.
-
-