Code example for ByteBuffer

Methods: get, hasRemaining

0
	} 
	 
	@Override 
	public int read() throws IOException 
	{ 
		return buffer.hasRemaining() ? (buffer.get() & 0xff) : -1;
	} 
	 
	@Override 
	public int read(byte b[], int off, int len) throws IOException
	{ 
		int remaining = buffer.remaining();
		len= len <= remaining ? len : remaining;
		buffer.get(b, off, len);
		return len;
	} 
	 
	public boolean markSupported() { return true; } 
	 
	public void mark(int readAheadLimit)
	{