func (h *fshandler) Read(sessionID [16]byte, request *read.Request) (xrdproto.Marshaler, xrdproto.ResponseStatus) {
	file := h.getFile(sessionID, request.Handle)
	if file == nil {
		return xrdproto.ServerError{
			Code:    xrdproto.InvalidRequest,
			Message: fmt.Sprintf("Invalid file handle: %v", request.Handle),
		}, xrdproto.Error
	}

	buf := make([]byte, request.Length)
	n, err := file.ReadAt(buf, request.Offset)
	if err != nil && err != io.EOF {
		return xrdproto.ServerError{
			Code:    xrdproto.IOError,
			Message: fmt.Sprintf("An IO error occurred: %v", err),
		}, xrdproto.Error
	}

	return read.Response{Data: buf[:n]}, xrdproto.Ok
}
// Read implements server.Handler.Read.
Read implements server.Handler.Read.
// Read implements server . Handler . Read .
func (h *fshandler) Read(sessionID [16]byte, request *read.Request) (xrdproto.Marshaler, xrdproto.ResponseStatus) {
	file := h.getFile(sessionID, request.Handle)
	if file == nil {
		return xrdproto.ServerError{
			Code:    xrdproto.InvalidRequest,
			Message: fmt.Sprintf("Invalid file handle: %v", request.Handle),
		}, xrdproto.Error
	}
	buf := make([]byte, request.Length)
	n, err := file.ReadAt(buf, request.Offset)
	if err != nil && err != io.EOF {
		return xrdproto.ServerError{
			Code:    xrdproto.IOError,
			Message: fmt.Sprintf("An IO error occurred: %v", err),
		}, xrdproto.Error
	}
	return read.Response{Data: buf[:n]}, xrdproto.Ok
}
func ( h * fshandler ) Read ( sessionID [ 16 ] byte , request * read . Request ) ( xrdproto . Marshaler , xrdproto . ResponseStatus ) { file := h . getFile ( sessionID , request . Handle ) if file == nil { return xrdproto . ServerError { Code : xrdproto . InvalidRequest , Message : fmt . Sprintf ( " " , request . Handle ) , } , xrdproto . Error } buf := make ( [ ] byte , request . Length ) n , err := file . ReadAt ( buf , request . Offset ) if err != nil && err != io . EOF { return xrdproto . ServerError { Code : xrdproto . IOError , Message : fmt . Sprintf ( " " , err ) , } , xrdproto . Error } return read . Response { Data : buf [ : n ] } , xrdproto . Ok }
Read implements server.Handler.Read.
Read implements server . Handler . Read .