Code example for BufferOverflowException

0
		itsBytes = aBytes;
	} 
	 
	protected void checkRemaining(int aRequested)
	{ 
		if (aRequested > remaining()) throw new BufferOverflowException();
	} 
	 
	public final void put(byte[] aBytes, int aOffset, int aLength)
	{ 
		checkRemaining(aLength);
		int thePos = itsPos;
		System.arraycopy(aBytes, aOffset, itsBytes, thePos, aLength);
		itsPos = thePos+aLength;
	} 
	 
	public final void get(byte[] aBuffer, int aOffset, int aLength)
	{ 
		checkRemaining(aLength);
		int thePos = itsPos;
		System.arraycopy(itsBytes, thePos, aBuffer, aOffset, aLength);