Lines Matching defs:bytes
42 /// Immutable array of bytes.
48 private readonly byte[] bytes;
59 internal static ByteString FromBytes(byte[] bytes)
61 return new ByteString(bytes);
65 /// Provides direct, unrestricted access to the bytes contained in this instance.
68 internal static byte[] GetBuffer(ByteString bytes)
70 return bytes.bytes;
77 internal static ByteString AttachBytes(byte[] bytes)
79 return new ByteString(bytes);
86 private ByteString(byte[] bytes)
88 this.bytes = bytes;
100 /// Returns the length of this ByteString in bytes.
104 get { return bytes.Length; }
122 return (byte[]) bytes.Clone();
131 return Convert.ToBase64String(bytes);
137 public static ByteString FromBase64(string bytes)
141 return bytes == "" ? Empty : new ByteString(Convert.FromBase64String(bytes));
151 public static ByteString CopyFrom(params byte[] bytes)
153 return new ByteString((byte[]) bytes.Clone());
159 public static ByteString CopyFrom(byte[] bytes, int offset, int count)
162 ByteArray.Copy(bytes, offset, portion, 0, count);
188 get { return bytes[index]; }
202 return encoding.GetString(bytes, 0, bytes.Length);
219 /// Returns an iterator over the bytes in this <see cref="ByteString"/>.
221 /// <returns>An iterator over the bytes in this object.</returns>
224 return ((IEnumerable<byte>) bytes).GetEnumerator();
228 /// Returns an iterator over the bytes in this <see cref="ByteString"/>.
230 /// <returns>An iterator over the bytes in this object.</returns>
242 return new CodedInputStream(bytes);
261 if (lhs.bytes.Length != rhs.bytes.Length)
267 if (rhs.bytes[i] != lhs.bytes[i])
304 foreach (byte b in bytes)
326 outputStream.WriteRawBytes(bytes, 0, bytes.Length);
334 ByteArray.Copy(bytes, 0, array, position, bytes.Length);
342 outputStream.Write(bytes, 0, bytes.Length);