Code example for FileChannel

Methods: mapsize

0
    private int position;
 
    public MappedFileDataInput(FileInputStream stream, String filename, int position) throws IOException
    { 
        FileChannel channel = stream.getChannel();
        buffer = channel.map(FileChannel.MapMode.READ_ONLY, position, channel.size());
        this.filename = filename;
        this.position = position;
    } 
 
    public MappedFileDataInput(MappedByteBuffer buffer, String filename, int position)
    { 
        assert buffer != null;
        this.buffer = buffer;
        this.filename = filename;
        this.position = position;
    } 
 
    // don't make this public, this is only for seeking WITHIN the current mapped segment 
    protected void seekInternal(int pos)
    {