public int readInt() throws MessageFormatException, MessageEOFException { checkEndOfStreamCondition(); checkByteArrayReadingInProgress(); final StreamItem streamItem = items.get(mark); final int i = StreamItemConversion.convertToInt(streamItem); mark++; return i; }
public char readChar() throws MessageFormatException, MessageEOFException { checkEndOfStreamCondition(); checkByteArrayReadingInProgress(); final StreamItem streamItem = items.get(mark); final char c = StreamItemConversion.convertToChar(streamItem); mark++; return c; }
public byte readByte() throws MessageFormatException, MessageEOFException { checkEndOfStreamCondition(); checkByteArrayReadingInProgress(); final StreamItem streamItem = items.get(mark); final byte b = StreamItemConversion.convertToByte(streamItem); mark++; return b; }
public long readLong() throws MessageFormatException, MessageEOFException { checkEndOfStreamCondition(); checkByteArrayReadingInProgress(); final StreamItem streamItem = items.get(mark); final long l = StreamItemConversion.convertToLong(streamItem); mark++; return l; }
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; }