Class RAMOutputStream
A memory-resident IndexOutput implementation.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public class RAMOutputStream : IndexOutput, IDisposable
Constructors
RAMOutputStream()
Construct an empty output buffer.
Declaration
public RAMOutputStream()
RAMOutputStream(RAMFile)
A memory-resident IndexOutput implementation.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public RAMOutputStream(RAMFile f)
Parameters
Type | Name | Description |
---|---|---|
RAMFile | f |
Properties
Checksum
Returns the current checksum of bytes written so far
Declaration
public override long Checksum { get; }
Property Value
Type | Description |
---|---|
long |
Overrides
Length
Gets or Sets the file length. By default, this property's setter does nothing (it's optional for a Directory to implement it). But, certain Directory implementations (for example FSDirectory) can use this to inform the underlying IO system to pre-allocate the file to the specified size. If the length is longer than the current file length, the bytes added to the file are undefined. Otherwise the file is truncated.
Declaration
public override long Length { get; set; }
Property Value
Type | Description |
---|---|
long |
Overrides
Position
Returns the current position in this file, where the next write will occur.
This was getFilePointer() in Lucene.Declaration
public override long Position { get; }
Property Value
Type | Description |
---|---|
long |
Overrides
See Also
Methods
Dispose(bool)
Closes this stream to further operations.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
Flush()
Forces any buffered output to be written.
Declaration
public override void Flush()
Overrides
GetSizeInBytes()
Returns byte usage of all buffers.
Declaration
public virtual long GetSizeInBytes()
Returns
Type | Description |
---|---|
long |
Reset()
Resets this to an empty file.
Declaration
public virtual void Reset()
Seek(long)
Sets current position in this file, where the next write will occur.
Declaration
[Obsolete("(4.1) this method will be removed in Lucene 5.0")]
public override void Seek(long pos)
Parameters
Type | Name | Description |
---|---|---|
long | pos |
Overrides
See Also
WriteByte(byte)
Writes a single byte.
The most primitive data type is an eight-bit byte. Files are accessed as sequences of bytes. All other data types are defined as sequences of bytes, so file formats are byte-order independent.Declaration
public override void WriteByte(byte b)
Parameters
Type | Name | Description |
---|---|---|
byte | b |
Overrides
See Also
WriteBytes(byte[], int, int)
Writes an array of bytes.
Declaration
public override void WriteBytes(byte[] b, int offset, int len)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | the bytes to write |
int | offset | the offset in the byte array |
int | len |
Overrides
See Also
WriteTo(DataOutput)
Copy the current contents of this buffer to the named output.
Declaration
public virtual void WriteTo(DataOutput @out)
Parameters
Type | Name | Description |
---|---|---|
DataOutput | out |
WriteTo(byte[], int)
Copy the current contents of this buffer to output byte array
Declaration
public virtual void WriteTo(byte[] bytes, int offset)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | |
int | offset |