Esempio n. 1
0
 public int readInt() throws MessageFormatException, MessageEOFException {
   checkEndOfStreamCondition();
   checkByteArrayReadingInProgress();
   final StreamItem streamItem = items.get(mark);
   final int i = StreamItemConversion.convertToInt(streamItem);
   mark++;
   return i;
 }
Esempio n. 2
0
 public char readChar() throws MessageFormatException, MessageEOFException {
   checkEndOfStreamCondition();
   checkByteArrayReadingInProgress();
   final StreamItem streamItem = items.get(mark);
   final char c = StreamItemConversion.convertToChar(streamItem);
   mark++;
   return c;
 }
Esempio n. 3
0
 public byte readByte() throws MessageFormatException, MessageEOFException {
   checkEndOfStreamCondition();
   checkByteArrayReadingInProgress();
   final StreamItem streamItem = items.get(mark);
   final byte b = StreamItemConversion.convertToByte(streamItem);
   mark++;
   return b;
 }
Esempio n. 4
0
 public long readLong() throws MessageFormatException, MessageEOFException {
   checkEndOfStreamCondition();
   checkByteArrayReadingInProgress();
   final StreamItem streamItem = items.get(mark);
   final long l = StreamItemConversion.convertToLong(streamItem);
   mark++;
   return l;
 }
Esempio n. 5
0
 public int readBytes(byte[] bytes) throws MessageFormatException, MessageEOFException {
   checkEndOfStreamCondition();
   if (bytes == null) return -1;
   final StreamItem streamItem = items.get(mark);
   final byte[] bytes1 = StreamItemConversion.convertToByteArray(streamItem);
   if (byteArrayReadingInProgress && byteArrayMark == bytes1.length) {
     endByteArrayReading();
     return -1;
   }
   byteArrayReadingInProgress = true;
   final int filled = ByteArrays.fillByteArray(bytes1, byteArrayMark, bytes);
   byteArrayMark += filled;
   if (byteArrayMark == bytes1.length && filled < bytes.length) {
     endByteArrayReading();
   }
   return filled;
 }