public final class WriteBuffers extends Object implements ByteStream.RandomAccessOutput
Modifier and Type | Class and Description |
---|---|
static class |
WriteBuffers.ByteSegmentRef
The class representing a segment of bytes in the buffer.
|
static class |
WriteBuffers.Position |
Constructor and Description |
---|
WriteBuffers(int wbSize,
long maxSize) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
getByteSegmentRefToCurrent(WriteBuffers.ByteSegmentRef byteSegmentRef,
int length,
WriteBuffers.Position readPos) |
int |
getLength() |
long |
getReadPoint() |
long |
getReadPoint(WriteBuffers.Position readPos) |
WriteBuffers.Position |
getReadPosition() |
long |
getWritePoint() |
int |
hashCode(byte[] key,
int offset,
int length) |
int |
hashCode(long offset,
int length) |
int |
hashCode(long offset,
int length,
WriteBuffers.Position readPos) |
boolean |
isEqual(byte[] left,
int leftOffset,
int leftLength,
long rightOffset,
int rightLength)
Compares part of the buffer with a part of an external byte array.
|
boolean |
isEqual(byte[] left,
int leftLength,
long rightOffset,
int rightLength)
Compares part of the buffer with a part of an external byte array.
|
boolean |
isEqual(long leftOffset,
int leftLength,
long rightOffset,
int rightLength)
Compares two parts of the buffer with each other.
|
static int |
murmurHash(byte[] data,
int offset,
int length) |
void |
populateValue(WriteBuffers.ByteSegmentRef value)
Changes the byte segment reference from being a reference to global buffer to
the one with a self-contained byte array.
|
int |
readInt(long offset) |
long |
readNByteLong(long offset,
int bytes) |
long |
readNByteLong(long offset,
int bytes,
WriteBuffers.Position readPos) |
int |
readVInt() |
int |
readVInt(WriteBuffers.Position readPos) |
long |
readVLong() |
long |
readVLong(WriteBuffers.Position readPos) |
void |
reserve(int byteCount) |
void |
seal() |
void |
setReadPoint(long offset) |
void |
setReadPoint(long offset,
WriteBuffers.Position readPos) |
void |
setWritePoint(long offset) |
long |
size()
Write buffer size
|
void |
skipVLong() |
void |
skipVLong(WriteBuffers.Position readPos) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeByte(long offset,
byte value) |
void |
writeBytes(long offset,
int length)
Reads some bytes from the buffer and writes them again at current write point.
|
void |
writeFiveByteULong(long offset,
long v) |
void |
writeInt(long offset,
int v) |
void |
writeVInt(int value) |
void |
writeVLong(long value) |
public int readVInt()
public int readVInt(WriteBuffers.Position readPos)
public long readVLong()
public long readVLong(WriteBuffers.Position readPos)
public void skipVLong()
public void skipVLong(WriteBuffers.Position readPos)
public void setReadPoint(long offset)
public void setReadPoint(long offset, WriteBuffers.Position readPos)
public int hashCode(long offset, int length)
public int hashCode(long offset, int length, WriteBuffers.Position readPos)
public int hashCode(byte[] key, int offset, int length)
public void reserve(int byteCount)
reserve
in interface ByteStream.RandomAccessOutput
public void setWritePoint(long offset)
public void write(int b)
write
in interface ByteStream.RandomAccessOutput
public void write(byte[] b)
write
in interface ByteStream.RandomAccessOutput
public void write(byte[] b, int off, int len)
write
in interface ByteStream.RandomAccessOutput
public int getLength()
getLength
in interface ByteStream.RandomAccessOutput
public boolean isEqual(long leftOffset, int leftLength, long rightOffset, int rightLength)
public boolean isEqual(byte[] left, int leftLength, long rightOffset, int rightLength)
public boolean isEqual(byte[] left, int leftOffset, int leftLength, long rightOffset, int rightLength)
public void clear()
public long getWritePoint()
public long getReadPoint()
public long getReadPoint(WriteBuffers.Position readPos)
public void getByteSegmentRefToCurrent(WriteBuffers.ByteSegmentRef byteSegmentRef, int length, WriteBuffers.Position readPos)
public void writeVInt(int value)
public void writeVLong(long value)
public void writeBytes(long offset, int length)
public void populateValue(WriteBuffers.ByteSegmentRef value)
public void seal()
public long readNByteLong(long offset, int bytes)
public long readNByteLong(long offset, int bytes, WriteBuffers.Position readPos)
public void writeFiveByteULong(long offset, long v)
public int readInt(long offset)
public void writeInt(long offset, int v)
writeInt
in interface ByteStream.RandomAccessOutput
public void writeByte(long offset, byte value)
writeByte
in interface ByteStream.RandomAccessOutput
public static int murmurHash(byte[] data, int offset, int length)
public long size()
public WriteBuffers.Position getReadPosition()
Copyright © 2017 The Apache Software Foundation. All rights reserved.