public class DataInputBlobReader<S extends MessageSchema<S>> extends ChannelReader
| Modifier and Type | Field and Description |
|---|---|
protected int |
bytesLowBound |
protected boolean |
isStructured |
protected int |
length |
protected int |
position |
protected TrieParserReader |
reader |
| Constructor and Description |
|---|
DataInputBlobReader(Pipe<S> pipe) |
| Modifier and Type | Method and Description |
|---|---|
int |
absolutePosition() |
static int |
absolutePosition(DataInputBlobReader<?> reader) |
static void |
absolutePosition(DataInputBlobReader<?> reader,
int position) |
void |
absolutePosition(int position) |
int |
accumHighLevelAPIField(int loc) |
int |
accumLowLevelAPIField() |
int |
available()
Will give how many bytes are available right now
|
static int |
bytesRemaining(DataInputBlobReader<?> that) |
static boolean |
convertTextToDecimal(TrieParserReader parserReader,
byte[] backing,
int position,
int available,
int mask,
DecimalResult result) |
static double |
convertTextToDouble(TrieParserReader parserReader,
byte[] backing,
int position,
int available,
int mask) |
static long |
convertTextToLong(TrieParserReader parserReader,
byte[] backing,
int position,
int mask,
int available) |
void |
debug() |
void |
debugUTF8() |
boolean |
equalBytes(byte[] bytes)
Checks to see if bytes passed are equal to bytes in ChannelReader
|
boolean |
equalBytes(byte[] bytes,
int bytesPos,
int bytesLen)
Checks to see if bytes passed are equal to bytes in ChannelReader
|
boolean |
equalUTF(byte[] equalText)
Reads data from ChannelReader and checks if the UTF text matches input text
|
static <S extends MessageSchema<S>> |
getBackingPipe(DataInputBlobReader<S> that) |
static int |
getStructType(DataInputBlobReader<?> reader) |
boolean |
hasRemainingBytes()
Checks to see if ChannelReader has remaining bytes
|
boolean |
isStructured()
Determines if ChannelReader is structured
|
static boolean |
isStructured(DataInputBlobReader<?> reader) |
int |
length() |
static int[] |
lookupDimArray(DataInputBlobReader reader,
int size,
int instance) |
DataInput |
nullable() |
int |
openHighLevelAPIField(int loc) |
int |
openLowLevelAPIField() |
static <S extends MessageSchema<S>> |
openLowLevelAPIField(DataInputBlobReader<S> that)
Deprecated.
|
long |
parse(TrieParserReader reader,
TrieParser trie,
int length)
Parses data in reader and returns numeric representation of trie
|
static int |
peekHighLevelAPIField(DataInputBlobReader<?> reader,
int loc) |
int |
peekLowLevelAPIField(int offset) |
static short |
peekShort(DataInputBlobReader<?> channelReader) |
int |
position() |
static void |
position(DataInputBlobReader<?> reader,
int byteIndexFromStart) |
void |
position(int position) |
int |
read()
Reads data from ChannelReader
|
int |
read(byte[] b)
Reads bytes from ChannelReader and puts them in b[]
|
int |
read(byte[] b,
int off,
int len)
Reads bytes from ChannelReader and puts them in b[]
|
static <S extends MessageSchema<S>> |
read(DataInputBlobReader<S> reader,
byte[] b,
int off,
int len,
int mask) |
boolean |
readBoolean()
Reads Boolean from ChannelReader
|
byte |
readByte()
Reads Byte from ChannelReader
|
char |
readChar() |
double |
readDecimalAsDouble()
Reads decimal from ChannelReader and passes to double
|
long |
readDecimalAsLong()
Reads decimal from ChannelReader and passes to long
|
double |
readDouble()
Reads Double from ChannelReader
|
float |
readFloat()
Reads Float from ChannelReader
|
void |
readFromEndInto(DataOutputBlobWriter<?> outputStream) |
int |
readFromEndLastInt(int negativeIntOffset) |
static int |
readFromLastInt(DataInputBlobReader<?> reader,
int pos) |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt()
Reads Int from ChannelReader
|
void |
readInto(ChannelWriter writer,
int length) |
<T extends MessageSchema<T>> |
readInto(DataOutputBlobWriter<T> writer,
int length) |
void |
readInto(Externalizable target)
Reads data from ChannelReader and passes it to target
|
String |
readLine() |
long |
readLong()
Reads Long from ChannelReader
|
Object |
readObject()
Reads data from ChannelReader and passes it to Object
|
<A extends Appendable> |
readPackedChars(A target)
Reads packed Chars from ChannelReader and passes them to target
|
static <S extends MessageSchema<S>> |
readPackedChars(DataInputBlobReader<S> that,
Appendable target) |
int |
readPackedInt()
Reads packed Int from ChannelReader and passes to int
|
static <S extends MessageSchema<S>> |
readPackedInt(DataInputBlobReader<S> that) |
long |
readPackedLong()
Parse a 64 bit signed value
|
static <S extends MessageSchema<S>> |
readPackedLong(DataInputBlobReader<S> that) |
short |
readPackedShort()
Reads packed Short from ChannelReader
|
double |
readRationalAsDouble()
Reads rational from ChannelReader and passes to double
|
short |
readShort()
Reads Short from ChannelReader
|
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF()
Reads UTF bytes from ChannelReader
|
<A extends Appendable> |
readUTF(A target)
Reads bytes from ChannelReader depending on leading short for length
assuming bytes are UTF-8 encoded passes them to target
|
static <A extends Appendable,S extends MessageSchema<S>> |
readUTF(DataInputBlobReader<S> reader,
int length,
A target) |
static double |
readUTFAsDecimal(DataInputBlobReader<?> reader) |
static long |
readUTFAsLong(DataInputBlobReader<?> reader) |
String |
readUTFFully()
Reads all UTF bytes from ChannelReader, does not use leading short
|
String |
readUTFOfLength(int length)
Will read bytes from ChannelReader, depending on available(), of a specified length
|
<A extends Appendable> |
readUTFOfLength(int length,
A target)
Reads specified length of bytes from ChannelReader depending on available() and, assuming they are UTF, passes them to target
|
static void |
releaseDimArray(DataInputBlobReader reader,
int size,
int instance) |
static int |
reserveDimArray(DataInputBlobReader reader,
int size,
int maxSize) |
void |
setPositionBytesFromStart(int byteIndexFromStart)
Deprecated.
|
static void |
setupParser(DataInputBlobReader<?> input,
TrieParserReader reader) |
static void |
setupParser(DataInputBlobReader<?> input,
TrieParserReader reader,
int length) |
long |
skip(long n) |
int |
skipBytes(int n)
Reads data from ChannelReader after skipping n bytes and passes data as int
|
static boolean |
structTypeValidation(DataInputBlobReader<?> reader,
int structId) |
StructuredReader |
structured()
Structures ChannelReader allowing access to field name
|
static TrieParser |
textToNumberTrieParser() |
boolean |
wasBooleanNull()
Reads data from ChannelReader and checks if null, if not passes as boolean
|
boolean |
wasDecimalNull()
Reads data from ChannelReader to check if data was decimal null
|
static <S extends MessageSchema<S>> |
wasDecimalNull(DataInputBlobReader<S> that) |
boolean |
wasPackedNull()
Reads data from ChannelReader to check if data was packed null
|
static <S extends MessageSchema<S>> |
wasPackedNull(DataInputBlobReader<S> that) |
close, mark, markSupported, resetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseprotected int length
protected int bytesLowBound
protected int position
protected boolean isStructured
protected TrieParserReader reader
public static int reserveDimArray(DataInputBlobReader reader, int size, int maxSize)
public static int[] lookupDimArray(DataInputBlobReader reader, int size, int instance)
public static void releaseDimArray(DataInputBlobReader reader, int size, int instance)
public void debug()
public void debugUTF8()
public int openHighLevelAPIField(int loc)
public static int peekHighLevelAPIField(DataInputBlobReader<?> reader, int loc)
public int readFromEndLastInt(int negativeIntOffset)
public static boolean structTypeValidation(DataInputBlobReader<?> reader, int structId)
public boolean isStructured()
ChannelReaderisStructured in class ChannelReadertrue if ChannelReader is structured else falsepublic static boolean isStructured(DataInputBlobReader<?> reader)
public static int getStructType(DataInputBlobReader<?> reader)
public static int readFromLastInt(DataInputBlobReader<?> reader, int pos)
public void readFromEndInto(DataOutputBlobWriter<?> outputStream)
public int openLowLevelAPIField()
public int peekLowLevelAPIField(int offset)
@Deprecated public static <S extends MessageSchema<S>> int openLowLevelAPIField(DataInputBlobReader<S> that)
public int accumLowLevelAPIField()
public int accumHighLevelAPIField(int loc)
public boolean hasRemainingBytes()
ChannelReaderhasRemainingBytes in class ChannelReadertrue if there are bytes remaining else falsepublic int available()
ChannelReaderavailable in interface ObjectInputavailable in class ChannelReaderpublic static int bytesRemaining(DataInputBlobReader<?> that)
public DataInput nullable()
public int absolutePosition()
absolutePosition in class ChannelReaderpublic void absolutePosition(int position)
absolutePosition in class ChannelReaderposition - the actual offset position in the array where you want to be right nowpublic static int absolutePosition(DataInputBlobReader<?> reader)
public static void absolutePosition(DataInputBlobReader<?> reader, int position)
public static void position(DataInputBlobReader<?> reader, int byteIndexFromStart)
public int position()
position in class ChannelReaderpublic void position(int position)
position in class ChannelReaderposition - offset that you want from the absolutePosition@Deprecated public void setPositionBytesFromStart(int byteIndexFromStart)
public int read(byte[] b)
ChannelReaderread in interface ObjectInputread in class ChannelReaderb - array to store bytes readpublic int read(byte[] b,
int off,
int len)
ChannelReaderread in interface ObjectInputread in class ChannelReaderb - array to store bytes readoff - offset to start readinglen - length of bytes to writepublic void readFully(byte[] b)
public void readFully(byte[] b,
int off,
int len)
public long skip(long n)
skip in interface ObjectInputskip in class InputStreampublic int skipBytes(int n)
ChannelReaderskipBytes in interface DataInputskipBytes in class ChannelReadern - number of bytes to skippublic boolean readBoolean()
ChannelReaderreadBoolean in interface DataInputreadBoolean in class ChannelReaderpublic boolean wasBooleanNull()
ChannelReaderwasBooleanNull in class ChannelReaderpublic byte readByte()
ChannelReaderreadByte in interface DataInputreadByte in class ChannelReaderpublic int readUnsignedByte()
public short readShort()
ChannelReaderreadShort in interface DataInputreadShort in class ChannelReaderpublic int readUnsignedShort()
public char readChar()
public int readInt()
ChannelReaderreadInt in interface DataInputreadInt in class ChannelReaderpublic long readLong()
ChannelReaderreadLong in interface DataInputreadLong in class ChannelReaderpublic float readFloat()
ChannelReaderreadFloat in interface DataInputreadFloat in class ChannelReaderpublic double readDouble()
ChannelReaderreadDouble in interface DataInputreadDouble in class ChannelReaderpublic int read()
ChannelReaderread in interface ObjectInputread in class ChannelReaderpublic String readLine()
public String readUTF()
ChannelReaderreadUTF in interface TextReaderreadUTF in interface DataInputreadUTF in class ChannelReaderpublic <A extends Appendable> A readUTF(A target)
ChannelReaderreadUTF in interface TextReaderreadUTF in class ChannelReadertarget - receiver of converted bytespublic String readUTFFully()
ChannelReaderreadUTFFully in class ChannelReaderpublic String readUTFOfLength(int length)
ChannelReaderreadUTFOfLength in class ChannelReaderlength - the number of bytes to readpublic <A extends Appendable> A readUTFOfLength(int length, A target)
ChannelReaderreadUTFOfLength in class ChannelReaderlength - the number of bytes to readtarget - receiver of converted bytespublic long parse(TrieParserReader reader, TrieParser trie, int length)
ChannelReaderparse in class ChannelReaderreader - source data to parse fromtrie - rules for parsinglength - max value to parsepublic boolean equalUTF(byte[] equalText)
ChannelReaderequalUTF in interface TextReaderequalUTF in class ChannelReaderequalText - text used for comparisonpublic boolean equalBytes(byte[] bytes)
ChannelReaderequalBytes in class ChannelReaderbytes - byte array to pass in for comparisontrue if bytes are equal else falsepublic boolean equalBytes(byte[] bytes,
int bytesPos,
int bytesLen)
ChannelReaderequalBytes in class ChannelReaderbytes - byte array to pass in for comparisonbytesPos - position to read frombytesLen - length of bytes to readtrue if bytes are equal else falsepublic static <A extends Appendable,S extends MessageSchema<S>> A readUTF(DataInputBlobReader<S> reader, int length, A target) throws IOException
IOExceptionpublic void readInto(Externalizable target)
ChannelReaderreadInto in class ChannelReadertarget - to receive data from ChannelReaderpublic Object readObject()
ChannelReaderreadObject in interface ObjectInputreadObject in class ChannelReaderpublic static <S extends MessageSchema<S>> int read(DataInputBlobReader<S> reader, byte[] b, int off, int len, int mask)
public void readInto(ChannelWriter writer, int length)
readInto in class ChannelReaderpublic <T extends MessageSchema<T>> void readInto(DataOutputBlobWriter<T> writer, int length)
public static TrieParser textToNumberTrieParser()
public static long readUTFAsLong(DataInputBlobReader<?> reader)
public static long convertTextToLong(TrieParserReader parserReader, byte[] backing, int position, int mask, int available)
public static double readUTFAsDecimal(DataInputBlobReader<?> reader)
public static double convertTextToDouble(TrieParserReader parserReader, byte[] backing, int position, int available, int mask)
public static boolean convertTextToDecimal(TrieParserReader parserReader, byte[] backing, int position, int available, int mask, DecimalResult result)
public <A extends Appendable> A readPackedChars(A target)
ChannelReaderreadPackedChars in class ChannelReadertarget - to receive packed Charstargetpublic static <S extends MessageSchema<S>> void readPackedChars(DataInputBlobReader<S> that, Appendable target)
public long readPackedLong()
readPackedLong in class ChannelReaderpublic final boolean wasPackedNull()
ChannelReaderwasPackedNull in class ChannelReadertrue if data was packed nullpublic final boolean wasDecimalNull()
ChannelReaderwasDecimalNull in class ChannelReadertrue if data was decimal nullpublic int readPackedInt()
ChannelReaderreadPackedInt in class ChannelReaderpublic double readDecimalAsDouble()
ChannelReaderreadDecimalAsDouble in class ChannelReaderpublic double readRationalAsDouble()
ChannelReaderreadRationalAsDouble in class ChannelReaderpublic long readDecimalAsLong()
ChannelReaderreadDecimalAsLong in class ChannelReaderpublic short readPackedShort()
ChannelReaderreadPackedShort in class ChannelReaderpublic static <S extends MessageSchema<S>> Pipe<S> getBackingPipe(DataInputBlobReader<S> that)
public static <S extends MessageSchema<S>> long readPackedLong(DataInputBlobReader<S> that)
public static <S extends MessageSchema<S>> int readPackedInt(DataInputBlobReader<S> that)
public static <S extends MessageSchema<S>> boolean wasPackedNull(DataInputBlobReader<S> that)
public static <S extends MessageSchema<S>> boolean wasDecimalNull(DataInputBlobReader<S> that)
public static void setupParser(DataInputBlobReader<?> input, TrieParserReader reader)
public static void setupParser(DataInputBlobReader<?> input, TrieParserReader reader, int length)
public StructuredReader structured()
ChannelReaderstructured in class ChannelReaderpublic static short peekShort(DataInputBlobReader<?> channelReader)
public int length()
Copyright © 2018. All Rights Reserved.