func (sr *SelectObjectResponse) analysisData(p []byte) (int, error) {
	var needReadLength int32
	lenP := int32(len(p))
	restByteLength := sr.Frame.PayloadLength - 8 - sr.Frame.ConsumedBytesLength
	if lenP <= restByteLength {
		needReadLength = lenP
	} else {
		needReadLength = restByteLength
	}
	n, err := sr.readLen(p[:needReadLength], time.Duration(sr.ReadTimeOut))
	if err != nil {
		return n, fmt.Errorf("read frame data error,%s", err.Error())
	}
	sr.Frame.ConsumedBytesLength += int32(n)
	err = sr.writerCheckCrc32(p[:n])
	return n, err
}
analysisData is reading the DataFrameType data of selectObject response body
package oss
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"hash"
	"hash/crc32"
	"io"
	"net/http"
	"time"
)
type SelectObjectResponse struct {
	StatusCode          int
	Headers             http.Header
	Body                io.ReadCloser
	Frame               SelectObjectResult
	ReadTimeOut         uint
	ClientCRC32         uint32
	ServerCRC32         uint32
	WriterForCheckCrc32 hash.Hash32
	Finish              bool
}
func (sr *SelectObjectResponse) Read(p []byte) (n int, err error) {
	n, err = sr.readFrames(p)
	return
}
func (sr *SelectObjectResponse) Close() error {
	return sr.Body.Close()
}
type PostSelectResult struct {
	Response *SelectObjectResponse
}
func (sr *SelectObjectResponse) readFrames(p []byte) (int, error) {
	var nn int
	var err error
	var checkValid bool
	if sr.Frame.OutputRawData == true {
		nn, err = sr.Body.Read(p)
		return nn, err
	}
	if sr.Finish {
		return 0, io.EOF
	}
	for {
		if sr.Frame.OpenLine != true {
			err = sr.analysisHeader()
			if err != nil {
				return nn, err
			}
		}
		if sr.Frame.FrameType == DataFrameType {
			n, err := sr.analysisData(p[nn:])
			if err != nil {
				return nn, err
			}
			nn += n
			if sr.Frame.ConsumedBytesLength == sr.Frame.PayloadLength-8 {
				checkValid, err = sr.checkPayloadSum()
				if err != nil || !checkValid {
					return nn, fmt.Errorf("%s", err.Error())
				}
				sr.emptyFrame()
			}
			if nn == len(p) {
				return nn, nil
			}
		} else if sr.Frame.FrameType == ContinuousFrameType {
			checkValid, err = sr.checkPayloadSum()
			if err != nil || !checkValid {
				return nn, fmt.Errorf("%s", err.Error())
			}
		} else if sr.Frame.FrameType == EndFrameType {
			err = sr.analysisEndFrame()
			if err != nil {
				return nn, err
			}
			checkValid, err = sr.checkPayloadSum()
			if checkValid {
				sr.Finish = true
			}
			return nn, err
		} else if sr.Frame.FrameType == MetaEndFrameCSVType {
			err = sr.analysisMetaEndFrameCSV()
			if err != nil {
				return nn, err
			}
			checkValid, err = sr.checkPayloadSum()
			if checkValid {
				sr.Finish = true
			}
			return nn, err
		} else if sr.Frame.FrameType == MetaEndFrameJSONType {
			err = sr.analysisMetaEndFrameJSON()
			if err != nil {
				return nn, err
			}
			checkValid, err = sr.checkPayloadSum()
			if checkValid {
				sr.Finish = true
			}
			return nn, err
		}
	}
	return nn, nil
}
type chanReadIO struct {
	readLen int
	err     error
}
func (sr *SelectObjectResponse) readLen(p []byte, timeOut time.Duration) (int, error) {
	r := sr.Body
	ch := make(chan chanReadIO, 1)
	defer close(ch)
	go func(p []byte) {
		var needReadLength int
		readChan := chanReadIO{}
		needReadLength = len(p)
		for {
			n, err := r.Read(p[readChan.readLen:needReadLength])
			readChan.readLen += n
			if err != nil {
				readChan.err = err
				ch <- readChan
				return
			}
			if readChan.readLen == needReadLength {
				break
			}
		}
		ch <- readChan
	}(p)
	select {
	case <-time.After(time.Second * timeOut):
		return 0, fmt.Errorf("requestId: %s, readLen timeout, timeout is %d(second),need read:%d", sr.Headers.Get(HTTPHeaderOssRequestID), timeOut, len(p))
	case result := <-ch:
		return result.readLen, result.err
	}
}
func (sr *SelectObjectResponse) analysisHeader() error {
	headFrameByte := make([]byte, 20)
	_, err := sr.readLen(headFrameByte, time.Duration(sr.ReadTimeOut))
	if err != nil {
		return fmt.Errorf("requestId: %s, Read response frame header failure,err:%s", sr.Headers.Get(HTTPHeaderOssRequestID), err.Error())
	}
	frameTypeByte := headFrameByte[0:4]
	sr.Frame.Version = frameTypeByte[0]
	frameTypeByte[0] = 0
	bytesToInt(frameTypeByte, &sr.Frame.FrameType)
	if sr.Frame.FrameType != DataFrameType && sr.Frame.FrameType != ContinuousFrameType &&
		sr.Frame.FrameType != EndFrameType && sr.Frame.FrameType != MetaEndFrameCSVType && sr.Frame.FrameType != MetaEndFrameJSONType {
		return fmt.Errorf("requestId: %s, Unexpected frame type: %d", sr.Headers.Get(HTTPHeaderOssRequestID), sr.Frame.FrameType)
	}
	payloadLengthByte := headFrameByte[4:8]
	bytesToInt(payloadLengthByte, &sr.Frame.PayloadLength)
	headCheckSumByte := headFrameByte[8:12]
	bytesToInt(headCheckSumByte, &sr.Frame.HeaderCheckSum)
	byteOffset := headFrameByte[12:20]
	bytesToInt(byteOffset, &sr.Frame.Offset)
	sr.Frame.OpenLine = true
	err = sr.writerCheckCrc32(byteOffset)
	return err
}