|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.io.RandomAccessFile
mnist.tools.MnistDbFile
public abstract class MnistDbFile
MNIST database file containing entries that can represent image or label data. Extends the standard random access file with methods for navigating over the entries. The file format is basically idx with specific header information. This includes a magic number for determining the type of stored entries, count of entries.
| Constructor Summary | |
|---|---|
MnistDbFile(java.lang.String name,
java.lang.String mode)
Creates new instance and reads the header information. |
|
| Method Summary | |
|---|---|
int |
getCount()
|
long |
getCurrentIndex()
The current entry index. |
int |
getEntryLength()
Number of bytes for each entry. |
int |
getHeaderSize()
|
void |
next()
Move to the next entry. |
void |
prev()
Move to the previous entry. |
void |
setCurrentIndex(long curr)
Set the required current entry index. |
| Methods inherited from class java.io.RandomAccessFile |
|---|
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MnistDbFile(java.lang.String name,
java.lang.String mode)
throws java.io.IOException,
java.io.FileNotFoundException
name - the system-dependent filenamemode - the access mode
java.io.IOException
java.io.FileNotFoundExceptionRandomAccessFile| Method Detail |
|---|
public long getCurrentIndex()
throws java.io.IOException
java.io.IOExceptionpublic void setCurrentIndex(long curr)
curr - the entry indexpublic int getHeaderSize()
public int getEntryLength()
public void next()
throws java.io.IOException
java.io.IOException
public void prev()
throws java.io.IOException
java.io.IOExceptionpublic int getCount()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||