func read()

in Sources/TwitterApacheThrift/MemoryBuffer.swift [34:41]


    func read(size: Int) throws -> Data {
        if buffer.count - offset < size || offset < 0 {
            throw ThriftDecoderError.readBufferOverflow
        }
        let data = buffer.subdata(in: offset..<offset+size)
        offset += size
        return data
    }