Class PagedBytes
Represents a logical byte[] as a series of pages. You can write-once into the logical byte[] (append only), using copy, and then retrieve slices (BytesRef) into it using fill.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Inheritance
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public sealed class PagedBytes
Constructors
| Improve this Doc View SourcePagedBytes(Int32)
1<<blockBits must be bigger than biggest single BytesRef slice that will be pulled.
Declaration
public PagedBytes(int blockBits)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | blockBits |
Methods
| Improve this Doc View SourceCopy(IndexInput, Int64)
Read this many bytes from in
.
Declaration
public void Copy(IndexInput in, long byteCount)
Parameters
Type | Name | Description |
---|---|---|
IndexInput | in | |
System.Int64 | byteCount |
Copy(BytesRef, BytesRef)
Copy BytesRef in, setting BytesRef out to the result.
Do not use this if you will use Freeze(true)
.
This only supports bytes.Length <= blockSize
/
Declaration
public void Copy(BytesRef bytes, BytesRef out)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | bytes | |
BytesRef | out |
CopyUsingLengthPrefix(BytesRef)
Copy bytes in, writing the length as a 1 or 2 byte vInt prefix.
Declaration
public long CopyUsingLengthPrefix(BytesRef bytes)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | bytes |
Returns
Type | Description |
---|---|
System.Int64 |
Freeze(Boolean)
Commits final byte[], trimming it if necessary and if trim
=true.
Declaration
public PagedBytes.Reader Freeze(bool trim)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | trim |
Returns
Type | Description |
---|---|
PagedBytes.Reader |
GetDataInput()
Returns a DataInput to read values from this PagedBytes instance.
Declaration
public PagedBytes.PagedBytesDataInput GetDataInput()
Returns
Type | Description |
---|---|
PagedBytes.PagedBytesDataInput |
GetDataOutput()
Returns a DataOutput that you may use to write into this PagedBytes instance. If you do this, you should not call the other writing methods (eg, copy); results are undefined.
Declaration
public PagedBytes.PagedBytesDataOutput GetDataOutput()
Returns
Type | Description |
---|---|
PagedBytes.PagedBytesDataOutput |
GetPointer()
Declaration
public long GetPointer()
Returns
Type | Description |
---|---|
System.Int64 |
RamBytesUsed()
Return approx RAM usage in bytes.
Declaration
public long RamBytesUsed()
Returns
Type | Description |
---|---|
System.Int64 |