java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.util.fst.GrowableByteArrayDataOutput
- All Implemented Interfaces:
Accountable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
private byte[]
private static final int
private int
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
ensureCapacity
(int capacityToWrite) Ensure we can write additional capacityToWrite bytes.byte[]
getBytes()
int
long
Return the memory usage of this object in bytes.void
setPosition
(int newLen) Set the position of the byte[], increasing the capacity if neededvoid
writeByte
(byte b) Writes a single byte.void
writeBytes
(byte[] b, int offset, int len) Writes an array of bytes.void
writeTo
(int srcOffset, byte[] dest, int destOffset, int len) Copies bytes from this store to a target byte array.void
writeTo
(DataOutput out) Writes all of our bytes to the targetDataOutput
.Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeGroupVInts, writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED -
INITIAL_SIZE
private static final int INITIAL_SIZE- See Also:
-
bytes
private byte[] bytes -
nextWrite
private int nextWrite
-
-
Constructor Details
-
GrowableByteArrayDataOutput
GrowableByteArrayDataOutput()
-
-
Method Details
-
writeByte
public void writeByte(byte b) Description copied from class:DataOutput
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.
- Specified by:
writeByte
in classDataOutput
- See Also:
-
writeBytes
public void writeBytes(byte[] b, int offset, int len) Description copied from class:DataOutput
Writes an array of bytes.- Specified by:
writeBytes
in classDataOutput
- Parameters:
b
- the bytes to writeoffset
- the offset in the byte arraylen
- the number of bytes to write- See Also:
-
getPosition
public int getPosition() -
getBytes
public byte[] getBytes() -
setPosition
public void setPosition(int newLen) Set the position of the byte[], increasing the capacity if needed -
ensureCapacity
private void ensureCapacity(int capacityToWrite) Ensure we can write additional capacityToWrite bytes.- Parameters:
capacityToWrite
- the additional bytes to write
-
writeTo
Writes all of our bytes to the targetDataOutput
.- Throws:
IOException
-
writeTo
public void writeTo(int srcOffset, byte[] dest, int destOffset, int len) Copies bytes from this store to a target byte array. -
ramBytesUsed
public long ramBytesUsed()Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-