getSuccessCallback :: (Flags -> Value -> IO a) -> Failure a
                   -> Handle -> Ptr Header -> IO a
getSuccessCallback success failure h p = do
    elen <- getExtraLength p
    tlen <- getTotalLength p
    len  <- hGetBuf h p 4
    if len /= 4
        then failure DataReadFailed
        else do
            flags <- peekWord32be p
            value <- L.hGet h (fromIntegral tlen - fromIntegral elen)
            success flags value
getSuccessCallback :: (Flags -> Value -> IO a) -> Failure a
                   -> Handle -> Ptr Header -> IO a
getSuccessCallback success failure h p = do
    elen <- getExtraLength p
    tlen <- getTotalLength p
    len  <- hGetBuf h p 4
    if len /= 4
        then failure DataReadFailed
        else do
            flags <- peekWord32be p
            value <- L.hGet h (fromIntegral tlen - fromIntegral elen)
            success flags value
getSuccessCallback success failure h p = do
    elen <- getExtraLength p
    tlen <- getTotalLength p
    len  <- hGetBuf h p 4
    if len /= 4
        then failure DataReadFailed
        else do
            flags <- peekWord32be p
            value <- L.hGet h (fromIntegral tlen - fromIntegral elen)
            success flags value