@Override
	public int onReadFile(String fileName, ByteBuffer buffer, long offset, DokanFileInfo arg3) throws DokanOperationException {
		FileHandle handle;
		synchronized (handles)
		{
			handle = handles.get(arg3.handle);
		}
		if (handle == null)
		{
			if (DEBUG)
				System.out.println("Invalid handle");
			
			throw new DokanOperationException(net.decasdev.dokan.WinError.ERROR_INVALID_HANDLE);
		}
		
		if (!handle.read)
		{
			if (DEBUG)
				System.out.println("No read access allowed");
			throw new DokanOperationException(net.decasdev.dokan.WinError.ERROR_ACCESS_DENIED);
		}
		
		try 
		{
			int read = fileSystem.read(handle, buffer, offset);
			if (DEBUG)
				System.out.println("ReadFile: " + fileName + ", offset: " + offset + ", read: " + read);
				
			return read;
		} catch (Exception e)
		{
			e.printStackTrace();
		}
		return 0;
	}