public abstract class MnistDbFile
extends java.io.RandomAccessFile
| Constructor and Description |
|---|
MnistDbFile(java.lang.String name,
java.lang.String mode)
Creates new instance and reads the header information.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCount() |
long |
getCurrentIndex()
The current entry index.
|
int |
getEntryLength()
Number of bytes for each entry.
|
int |
getHeaderSize() |
protected abstract int |
getMagicNumber()
MNIST DB files start with unique integer number.
|
void |
next()
Move to the next entry.
|
void |
prev()
Move to the previous entry.
|
void |
setCurrentIndex(long curr)
Set the required current entry index.
|
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, writeUTFpublic MnistDbFile(java.lang.String name,
java.lang.String mode)
throws java.io.IOException
name - the system-dependent filenamemode - the access modejava.io.IOExceptionjava.io.FileNotFoundExceptionRandomAccessFileprotected abstract int getMagicNumber()
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.IOExceptionpublic void prev()
throws java.io.IOException
java.io.IOExceptionpublic int getCount()