Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: common/chunkstream/chunk.go

Issue 1413923013: Add `chunk` segmented data library. (Closed) Base URL: https://github.com/luci/luci-go@logdog-review-streamserver
Patch Set: Use errors in pacnic. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/chunkstream/buffer_test.go ('k') | common/chunkstream/chunkNode.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/chunkstream/chunk.go
diff --git a/common/chunkstream/chunk.go b/common/chunkstream/chunk.go
new file mode 100644
index 0000000000000000000000000000000000000000..3610e514c05af9184f0860ad106ee3f62b335fb2
--- /dev/null
+++ b/common/chunkstream/chunk.go
@@ -0,0 +1,19 @@
+// 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 {
+ // Bytes returns the underlying byte slice contained by this Chunk.
+ Bytes() []byte
+
+ // Release releases the Chunk. After being released, a Chunk's methods may no
+ // longer be used.
+ Release()
+}
« no previous file with comments | « common/chunkstream/buffer_test.go ('k') | common/chunkstream/chunkNode.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698