Code example for BufferUnderflowException

Methods: printStackTrace

0
 			byte[] b = new byte[2];
 			System.out.println("r: " + bis.read(b));
 		} catch (IOException e) {
 			e.printStackTrace();
		} catch (BufferUnderflowException e) {
			e.printStackTrace();
		} 
	} 
	 
	@Test
	public void rewindTest() {  
		ChainBuffer buffer = new ChainBuffer();
		byte[] testArray = new byte[] { 1, 2, 3, 4 };
		byte[] testArray2 = new byte[] { 5, 6, 7, 8, 9 };
		byte[] testArray3 = new byte[] { 10, 11, 12 };
		 
 		buffer.addLast(testArray);
 		buffer.addLast(testArray2);
 		buffer.addLast(testArray3);