Commit 71f203a1 authored by Charles Stanhope's avatar Charles Stanhope

Added CodedInputStream ctor symmetrical with CodedOutputStream.

committer: Arnold Zokas <arnold.zokas@coderoom.net>
parent 89694ecc
...@@ -105,13 +105,22 @@ namespace Google.ProtocolBuffers { ...@@ -105,13 +105,22 @@ namespace Google.ProtocolBuffers {
/// byte array. /// byte array.
/// </summary> /// </summary>
public static CodedInputStream CreateInstance(byte[] buf) { public static CodedInputStream CreateInstance(byte[] buf) {
return new CodedInputStream(buf); return new CodedInputStream(buf, 0, buf.Length);
} }
private CodedInputStream(byte[] buffer) { /// <summary>
this.buffer = buffer; /// Creates a new CodedInputStream that reads from the given
this.bufferSize = buffer.Length; /// byte array slice.
this.input = null; /// </summary>
public static CodedInputStream CreateInstance(byte[] buf, int offset, int length) {
return new CodedInputStream(buf, offset, length);
}
private CodedInputStream(byte[] buffer, int offset, int length) {
this.buffer = buffer;
this.bufferPos = offset;
this.bufferSize = offset + length;
this.input = null;
} }
private CodedInputStream(Stream input) { private CodedInputStream(Stream input) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment