Chromium Code Reviews| Index: common/chunkstream/chunk.go |
| diff --git a/common/chunkstream/chunk.go b/common/chunkstream/chunk.go |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..57c973ffad4539dfad6a2544e0dbbd5791dc742a |
| --- /dev/null |
| +++ b/common/chunkstream/chunk.go |
| @@ -0,0 +1,21 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package chunkstream |
| + |
| +// Chunk wraps a fixed-size byte buffer. It is the primary interface used by |
| +// the chunk library. |
| +// |
| +// A Chunk reference should be released once the user is finished with it. After |
| +// being released, it may no longer be accessed. |
| +type Chunk interface { |
|
iannucci
2015/11/05 01:10:08
Is this intended to be used outside of the package
dnj
2015/11/13 23:22:03
I'm going to kill Len().
|
| + // Bytes returns the underlying byte slice contained by this Chunk. |
| + Bytes() []byte |
| + // Len returns the length of the underlying byte slice. |
| + Len() int |
|
iannucci
2015/11/05 01:10:07
maybe no Len() and then put Len() on chunkNode
dnj
2015/11/13 23:22:03
Done.
|
| + |
| + // Release releases the Chunk. After being released, a Chunk's methods may no |
| + // longer be used. |
| + Release() |
| +} |