Code example for ByteBuffer

Methods: get, remaining

0
	} 
	 
	@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)
	{ 
		mark = buffer.position();
	} 
 
	public void reset() 
	{ 
		if ( mark == -1 ) throw new IllegalStateException();