|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.apache.hadoop.hive.ql.io.NonSyncDataInputBuffer
public class NonSyncDataInputBuffer
A thread-not-safe version of Hadoop's DataInputBuffer, which removes all synchronized modifiers.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
NonSyncDataInputBuffer()
Constructs a new empty buffer. |
Method Summary | |
---|---|
static String |
convertUTF8WithBuf(byte[] buf,
char[] out,
int offset,
int utfSize)
|
int |
getLength()
Returns the length of the input. |
int |
getPosition()
Returns the current position in the input. |
int |
read(byte[] buffer)
Reads bytes from the source stream into the byte array buffer . |
int |
read(byte[] buffer,
int offset,
int length)
Read at most length bytes from this DataInputStream and stores
them in byte array buffer starting at offset . |
boolean |
readBoolean()
Reads a boolean from this stream. |
byte |
readByte()
Reads an 8-bit byte value from this stream. |
char |
readChar()
|
double |
readDouble()
Reads a 64-bit double value from this stream. |
float |
readFloat()
Reads a 32-bit float value from this stream. |
void |
readFully(byte[] buffer)
Reads bytes from this stream into the byte array buffer . |
void |
readFully(byte[] buffer,
int offset,
int length)
Reads bytes from this stream and stores them in the byte array buffer starting at the position offset . |
int |
readInt()
Reads a 32-bit integer value from this stream. |
String |
readLine()
Deprecated. Use BufferedReader |
long |
readLong()
Reads a 64-bit long value from this stream. |
short |
readShort()
Reads a 16-bit short value from this stream. |
int |
readUnsignedByte()
Reads an unsigned 8-bit byte value from this stream and
returns it as an int. |
int |
readUnsignedShort()
Reads a 16-bit unsigned short value from this stream and
returns it as an int. |
String |
readUTF()
Reads a UTF format String from this Stream. |
static String |
readUTF(DataInput in)
Reads a UTF format String from the DataInput Stream in . |
void |
reset(byte[] input,
int length)
Resets the data that the buffer reads. |
void |
reset(byte[] input,
int start,
int length)
Resets the data that the buffer reads. |
int |
skipBytes(int count)
Skips count number of bytes in this stream. |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NonSyncDataInputBuffer()
Method Detail |
---|
public void reset(byte[] input, int length)
public void reset(byte[] input, int start, int length)
public int getPosition()
public int getLength()
public final int read(byte[] buffer) throws IOException
buffer
.
The number of bytes actually read is returned.
read
in class FilterInputStream
buffer
- the buffer to read bytes into
IOException
- If a problem occurs reading from this DataInputStream.public final int read(byte[] buffer, int offset, int length) throws IOException
length
bytes from this DataInputStream and stores
them in byte array buffer
starting at offset
.
Answer the number of bytes actually read or -1 if no bytes were read and
end of stream was encountered.
read
in class FilterInputStream
buffer
- the byte array in which to store the read bytes.offset
- the offset in buffer
to store the read bytes.length
- the maximum number of bytes to store in buffer
.
IOException
- If a problem occurs reading from this DataInputStream.public final boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
- If a problem occurs reading from this DataInputStream.public final byte readByte() throws IOException
readByte
in interface DataInput
IOException
- If a problem occurs reading from this DataInputStream.public final char readChar() throws IOException
readChar
in interface DataInput
IOException
public final double readDouble() throws IOException
double
value from this stream.
readDouble
in interface DataInput
double
value from the source stream.
IOException
- If a problem occurs reading from this DataInputStream.public final float readFloat() throws IOException
float
value from this stream.
readFloat
in interface DataInput
float
value from the source stream.
IOException
- If a problem occurs reading from this DataInputStream.public final void readFully(byte[] buffer) throws IOException
buffer
. This
method will block until buffer.length
number of bytes have
been read.
readFully
in interface DataInput
buffer
- to read bytes into
IOException
- If a problem occurs reading from this DataInputStream.public final void readFully(byte[] buffer, int offset, int length) throws IOException
buffer
starting at the position offset
. This
method blocks until count
bytes have been read.
readFully
in interface DataInput
buffer
- the byte array into which the data is readoffset
- the offset the operation start atlength
- the maximum number of bytes to read
IOException
- if a problem occurs while reading from this stream
EOFException
- if reaches the end of the stream before enough bytes have been
readpublic final int readInt() throws IOException
readInt
in interface DataInput
int
value from the source stream.
IOException
- If a problem occurs reading from this DataInputStream.@Deprecated public final String readLine() throws IOException
String
representing the next line of text available
in this BufferedReader. A line is represented by 0 or more characters
followed by '\n'
, '\r'
, "\n\r"
or
end of stream. The String
does not include the newline
sequence.
readLine
in interface DataInput
IOException
- If the DataInputStream is already closed or some other IO error
occurs.public final long readLong() throws IOException
long
value from this stream.
readLong
in interface DataInput
long
value from the source stream.
IOException
- If a problem occurs reading from this DataInputStream.public final short readShort() throws IOException
short
value from this stream.
readShort
in interface DataInput
short
value from the source stream.
IOException
- If a problem occurs reading from this DataInputStream.public final int readUnsignedByte() throws IOException
byte
value from this stream and
returns it as an int.
readUnsignedByte
in interface DataInput
IOException
- If a problem occurs reading from this DataInputStream.public final int readUnsignedShort() throws IOException
short
value from this stream and
returns it as an int.
readUnsignedShort
in interface DataInput
short
value from the source stream.
IOException
- If a problem occurs reading from this DataInputStream.public final String readUTF() throws IOException
readUTF
in interface DataInput
IOException
- If a problem occurs reading from this DataInputStream.public static final String readUTF(DataInput in) throws IOException
in
.
in
- the input stream to read from
IOException
- If a problem occurs reading from this DataInputStream.public final int skipBytes(int count) throws IOException
count
number of bytes in this stream. Subsequent
read()
's will not return these bytes unless
reset()
is used.
skipBytes
in interface DataInput
count
- the number of bytes to skip.
IOException
- If the stream is already closed or another IOException occurs.public static String convertUTF8WithBuf(byte[] buf, char[] out, int offset, int utfSize) throws UTFDataFormatException
UTFDataFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |