Guava LittleEndianDataInputStream - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava LittleEndianDataInputStream class.

This code example shows how to use the following methods:readByte, readInt, readLong, readShort
	} 
 
	void fromRawExtended(byte[] header) throws IncomingException {
		try { 
			@SuppressWarnings("resource") 
			LittleEndianDataInputStream stream = new LittleEndianDataInputStream(new ByteArrayInputStream(header));
			if (stream.readShort() != 2) {
				throw new IncomingException(); 
			} 
			stream.readLong();
			mJobSource = stream.readLong();
			if (stream.readByte() != -17) {
				throw new IncomingException(); 
			} 
			mSteamID = stream.readLong();
			mSessionID = stream.readInt();
		} catch (IOException e) {
			throw new IncomingException(); 
		} 
	} 
 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:readInt
	} 
 
	@Override 
	void fromRaw(byte[] data) throws IncomingException {
		try { 
			LittleEndianDataInputStream stream = new LittleEndianDataInputStream(new ByteArrayInputStream(data));
			mUniqueID = stream.readInt();
			byte[] key = new byte[20];
			Utility.readFromStream(stream, key);
			mLoginKey = new String(key);
		} catch (IOException e) {
			throw new IncomingException(); 
		} 
	} 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:readInt
 
	@Override 
	void fromRaw(byte[] data) throws IncomingException {
		try { 
			@SuppressWarnings("resource") 
			LittleEndianDataInputStream stream = new LittleEndianDataInputStream(new ByteArrayInputStream(data));
			mEResult = stream.readInt();
		} catch (IOException e) {
			throw new IncomingException(); 
		} 
	} 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:readInt
 
	@Override 
	void fromRaw(byte[] data) throws IncomingException {
		try { 
			@SuppressWarnings("resource") 
			LittleEndianDataInputStream stream = new LittleEndianDataInputStream(new ByteArrayInputStream(data));
			mProtocolVersion = stream.readInt();
			mUniverse = stream.readInt();
		} catch (IOException e) {
			throw new IncomingException(); 
		} 
	} 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:readInt
 
	@Override 
	void fromRaw(byte[] data) throws IncomingException {
		try { 
			@SuppressWarnings("resource") 
			LittleEndianDataInputStream stream = new LittleEndianDataInputStream(new ByteArrayInputStream(data));
			mEResult = stream.readInt();
		} catch (IOException e) {
			throw new IncomingException(); 
		} 
	} 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:readUnsignedShort
 
    @Override 
    public int readUnsignedShort() 
    { 
        try { 
            return dataInputStream.readUnsignedShort();
        } 
        catch (IOException e) {
            throw new RuntimeIOException(e);
        } 
    } 
 
    @Override 
    public int readInt() 
    { 
        try { 
            return dataInputStream.readInt();
        } 
        catch (IOException e) {
            throw new RuntimeIOException(e);
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        buffer = ByteBuffer.allocate(bufferSize);
        buffer.limit(0);
        if (order == ByteOrder.BIG_ENDIAN) {
            dataInput = new DataInputStream(this);
        } else { 
            dataInput = new LittleEndianDataInputStream(this);
        } 
    } 
 
    private boolean fillBuffer() throws IOException {
        buffer.position(0);
        int limit = (int)Math.min((channel.size() - channel.position()), buffer.capacity());
        buffer.limit(limit);
        if (limit == 0) return false;
        bufferPos = channel.position();
        channel.read(buffer);
        buffer.flip();
        return true; 
    } 
 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Guava LittleEndianDataInputStream Methods: