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 longprivate byte[]private static final intprivate intFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidensureCapacity(int capacityToWrite) Ensure we can write additional capacityToWrite bytes.byte[]getBytes()intlongReturn the memory usage of this object in bytes.voidsetPosition(int newLen) Set the position of the byte[], increasing the capacity if neededvoidwriteByte(byte b) Writes a single byte.voidwriteBytes(byte[] b, int offset, int len) Writes an array of bytes.voidwriteTo(int srcOffset, byte[] dest, int destOffset, int len) Copies bytes from this store to a target byte array.voidwriteTo(DataOutput out) Writes all of our bytes to the targetDataOutput.Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLongMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:DataOutputWrites 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:
writeBytein classDataOutput- See Also:
-
writeBytes
public void writeBytes(byte[] b, int offset, int len) Description copied from class:DataOutputWrites an array of bytes.- Specified by:
writeBytesin 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:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-