@Override
    @Synchronized
    public ByteBuffer read(long timeout) throws EndOfSegmentException, SegmentTruncatedException {
        long originalOffset = in.getOffset();
        long traceId = LoggerHelpers.traceEnter(log, "read", getSegmentId(), originalOffset, timeout);
        boolean success = false;
        try {
            ByteBuffer result = readEvent(timeout);
            success = true;
            return result;
        } finally {
            LoggerHelpers.traceLeave(log, "read", traceId, getSegmentId(), originalOffset, timeout, success);
            if (!success) {
                in.setOffset(originalOffset);
            }
        }
    }
@ Override @ Synchronized public ByteBuffer read ( long timeout ) throws EndOfSegmentException , SegmentTruncatedException { long originalOffset = in . getOffset ( ) ; long traceId = LoggerHelpers . traceEnter ( log , "read" , getSegmentId ( ) , originalOffset , timeout ) ; boolean success = false ; try { ByteBuffer result = readEvent ( timeout ) ; success = true ; return result ; } finally { LoggerHelpers . traceLeave ( log , "read" , traceId , getSegmentId ( ) , originalOffset , timeout , success ) ; if ( ! success ) { in . setOffset ( originalOffset ) ; } } }
@see EventSegmentReader#read()