| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

public interface IDataSource
A data source is an I/O resource capable of providing data.
| Method Summary | |
|---|---|
|  int | read(ByteBuffer buffer)see ReadableByteChannel.read(ByteBuffer) | 
|  byte | readByte()read a byte | 
|  ByteBuffer[] | readByteBufferByDelimiter(String delimiter)read a ByteBuffer by using a delimiter. | 
|  ByteBuffer[] | readByteBufferByDelimiter(String delimiter,
                          int maxLength)read a ByteBuffer by using a delimiter | 
|  ByteBuffer[] | readByteBufferByLength(int length)read a ByteBuffer by using a length definition | 
|  byte[] | readBytesByDelimiter(String delimiter)read a byte array by using a delimiter For performance reasons, the ByteBuffer readByteBuffer method is generally preferable to get bytes | 
|  byte[] | readBytesByDelimiter(String delimiter,
                     int maxLength)read a byte array by using a delimiter For performance reasons, the ByteBuffer readByteBuffer method is generally preferable to get bytes | 
|  byte[] | readBytesByLength(int length)read bytes by using a length definition For performance reasons, the ByteBuffer readByteBuffer method is generally preferable to get bytes | 
|  double | readDouble()read a double | 
|  int | readInt()read an int | 
|  long | readLong()read a long | 
|  short | readShort()read a short value | 
|  String | readStringByDelimiter(String delimiter)read a string by using a delimiter | 
|  String | readStringByDelimiter(String delimiter,
                      int maxLength)read a string by using a delimiter | 
|  String | readStringByLength(int length)read a string by using a length definition | 
|  long | transferTo(WritableByteChannel target,
           int length)transfer the data of the this source channel to the given data sink | 
| Method Detail | 
|---|
int read(ByteBuffer buffer)
         throws IOException
ReadableByteChannel.read(ByteBuffer)
IOException
byte readByte()
              throws IOException
IOException - If an I/O error occurs
short readShort()
                throws IOException
IOException - If an I/O error occurs
int readInt()
            throws IOException
IOException - If an I/O error occurs
long readLong()
              throws IOException
IOException - If an I/O error occurs
double readDouble()
                  throws IOException
IOException - If an I/O error occurs
byte[] readBytesByLength(int length)
                         throws IOException
length - the amount of bytes to read
IOException - If some other I/O error occurs
IllegalArgumentException - if the length parameter is negative
ByteBuffer[] readByteBufferByDelimiter(String delimiter)
                                       throws IOException
readByteBufferByDelimiter(String, int) method is generally preferable.
delimiter - the delimiter (by using the default encoding)
IOException - If an I/O error occurs
ByteBuffer[] readByteBufferByDelimiter(String delimiter,
                                       int maxLength)
                                       throws IOException,
                                              MaxReadSizeExceededException
delimiter - the delimiter (by using the default encoding)maxLength - the max length of bytes that should be read. If the limit is exceeded a MaxReadSizeExceededException will been thrown
MaxReadSizeExceededException - If the max read length has been exceeded and the delimiter hasn’t been found
IOException - If some other I/O error occurs
ByteBuffer[] readByteBufferByLength(int length)
                                    throws IOException
length - the amount of bytes to read
IOException - If some other I/O error occurs
IllegalArgumentException, - if the length parameter is negative
String readStringByLength(int length)
                          throws IOException,
                                 BufferUnderflowException
length - the amount of bytes to read
IOException - If some other I/O error occurs
UnsupportedEncodingException - if the given encoding is not supported
IllegalArgumentException, - if the length parameter is negative
BufferUnderflowException
String readStringByDelimiter(String delimiter)
                             throws IOException,
                                    UnsupportedEncodingException
delimiter - the delimiter (by using the default encoding)
IOException - If some other I/O error occurs
UnsupportedEncodingException - if the default encoding is not supported
byte[] readBytesByDelimiter(String delimiter)
                            throws IOException
delimiter - the delimiter (by using the default encoding)
IOException - If an I/O error occurs
byte[] readBytesByDelimiter(String delimiter,
                            int maxLength)
                            throws IOException,
                                   MaxReadSizeExceededException
delimiter - the delimiter (by using the default encoding)maxLength - the max length of bytes that should be read. If the limit is exceeded a MaxReadSizeExceededException will been thrown
MaxReadSizeExceededException - If the max read length has been exceeded and the delimiter hasn’t been found
IOException - If some other I/O error occurs
String readStringByDelimiter(String delimiter,
                             int maxLength)
                             throws IOException,
                                    UnsupportedEncodingException,
                                    MaxReadSizeExceededException
delimiter - the delimiter (by using the default encoding)maxLength - the max length of bytes that should be read. If the limit is exceeded a MaxReadSizeExceededException will been thrown
MaxReadSizeExceededException - If the max read length has been exceeded and the delimiter hasn’t been found
IOException - If some other I/O error occurs
UnsupportedEncodingException - If the given encoding is not supported
long transferTo(WritableByteChannel target,
                int length)
                throws IOException,
                       ClosedChannelException
dataSink - the data sinklength - the size to transfer
ClosedChannelException - If either this channel or the target channel is closed
IOException - If some other I/O error occurs| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||