private int ReadCompressedIntegerOrInvalid() { int bytesRead; int value = _block.PeekCompressedInteger(this.Offset, out bytesRead); _currentPointer += bytesRead; return(value); }
internal byte[] GetBytes(BlobHandle handle) { int offset = handle.GetHeapOffset(); int bytesRead; int numberOfBytes = Block.PeekCompressedInteger(offset, out bytesRead); if (numberOfBytes == BlobReader.InvalidCompressedInteger) { return(ImmutableArray <byte> .Empty.UnderlyingArray); } return(Block.PeekBytes(offset + bytesRead, numberOfBytes)); }
internal byte[] GetBytes(BlobHandle handle) { if (handle.IsVirtual) { // consider: if we returned an ImmutableArray we wouldn't need to copy return(GetVirtualBlobBytes(handle, unique: true)); } int offset = handle.GetHeapOffset(); int bytesRead; int numberOfBytes = Block.PeekCompressedInteger(offset, out bytesRead); if (numberOfBytes == BlobReader.InvalidCompressedInteger) { return(EmptyArray <byte> .Instance); } return(Block.PeekBytes(offset + bytesRead, numberOfBytes)); }