mnist.tools
Class MnistLabelFile

java.lang.Object
  extended by java.io.RandomAccessFile
      extended by mnist.tools.MnistDbFile
          extended by mnist.tools.MnistLabelFile
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput, java.io.DataOutput

public class MnistLabelFile
extends MnistDbFile

MNIST database label file.


Constructor Summary
MnistLabelFile(java.lang.String name, java.lang.String mode)
          Creates new MNIST database label file ready for reading.
 
Method Summary
 int readLabel()
          Reads the integer at the current position.
 
Methods inherited from class mnist.tools.MnistDbFile
getCount, getCurrentIndex, getEntryLength, getHeaderSize, next, prev, setCurrentIndex
 
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

MnistLabelFile

public MnistLabelFile(java.lang.String name,
                      java.lang.String mode)
               throws java.io.FileNotFoundException,
                      java.io.IOException
Creates new MNIST database label file ready for reading.

Parameters:
name - the system-dependent filename
mode - the access mode
Throws:
java.io.IOException
java.io.FileNotFoundException
Method Detail

readLabel

public int readLabel()
              throws java.io.IOException
Reads the integer at the current position.

Returns:
integer representing the label
Throws:
java.io.IOException