mirror of
https://github.com/minio/minio.git
synced 2025-03-13 05:00:11 -04:00
Renaming Write to WriteFrame
This commit is contained in:
parent
8ab0cc29f2
commit
6c2428833a
@ -73,7 +73,7 @@ type DonutFrameFooter struct {
|
|||||||
|
|
||||||
type Data bytes.Buffer
|
type Data bytes.Buffer
|
||||||
|
|
||||||
func Write(target io.Writer, reader io.Reader, length uint64) error {
|
func WriteFrame(target io.Writer, reader io.Reader, length uint64) error {
|
||||||
// write header
|
// write header
|
||||||
header := DonutFrameHeader{
|
header := DonutFrameHeader{
|
||||||
MagicMINI: MagicMINI,
|
MagicMINI: MagicMINI,
|
||||||
|
@ -39,7 +39,7 @@ func (s *MySuite) TestSingleWrite(c *C) {
|
|||||||
|
|
||||||
testData := "Hello, World"
|
testData := "Hello, World"
|
||||||
testLength := uint64(len(testData))
|
testLength := uint64(len(testData))
|
||||||
err := Write(&testBuffer, bytes.NewBufferString(testData), testLength)
|
err := WriteFrame(&testBuffer, bytes.NewBufferString(testData), testLength)
|
||||||
c.Assert(err, IsNil)
|
c.Assert(err, IsNil)
|
||||||
|
|
||||||
testBufferLength := uint64(testBuffer.Len())
|
testBufferLength := uint64(testBuffer.Len())
|
||||||
@ -127,7 +127,7 @@ func (s *MySuite) TestSingleWrite(c *C) {
|
|||||||
|
|
||||||
func (s *MySuite) TestLengthMismatchInWrite(c *C) {
|
func (s *MySuite) TestLengthMismatchInWrite(c *C) {
|
||||||
var testData bytes.Buffer
|
var testData bytes.Buffer
|
||||||
err := Write(&testData, bytes.NewBufferString("hello, world"), 5)
|
err := WriteFrame(&testData, bytes.NewBufferString("hello, world"), 5)
|
||||||
c.Assert(err, Not(IsNil))
|
c.Assert(err, Not(IsNil))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ func benchmarkSize(b *testing.B, size int) {
|
|||||||
b.SetBytes(int64(size))
|
b.SetBytes(int64(size))
|
||||||
target := new(bytes.Buffer)
|
target := new(bytes.Buffer)
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
Write(target, bytes.NewReader(buf[:size]), uint64(size))
|
WriteFrame(target, bytes.NewReader(buf[:size]), uint64(size))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user