### Question:
ByteUtilities { static void shift(byte[] bytes, byte[] newBytes, int newByteLength) { if (newBytes.length >= bytes.length) { System.arraycopy(newBytes, newByteLength - bytes.length, bytes, 0, bytes.length); } else { System.arraycopy(bytes, newByteLength, bytes, 0, bytes.length - newByteLength); System.arraycopy(newBytes, 0, bytes, bytes.length - newByteLength, newByteLength); } } private  ByteUtilities(); static int readNBytes(InputStream in, OutputStream out, int byteCount); static boolean readUntilInclusive(PushbackInputStream in, OutputStream out, byte[] marker);  }### Answer:
@Test public void testShift() { byte[] bytes = new byte[] { 0, 0, 0 }; ByteUtilities.shift(bytes, new byte[] { 1, 2, 3, 4, 5 }, 5); Assert.assertTrue(Arrays.equals(new byte[] { 3, 4, 5 }, bytes)); ByteUtilities.shift(bytes, new byte[] { 1, 2, 3 }, 3); Assert.assertTrue(Arrays.equals(new byte[] { 1, 2, 3 }, bytes)); bytes = new byte[] { 0, 1, 2, 3, 4, 5 }; ByteUtilities.shift(bytes, new byte[] { 6, 7 }, 2); Assert.assertTrue(Arrays.equals(new byte[] { 2, 3, 4, 5, 6, 7 }, bytes)); ByteUtilities.shift(bytes, new byte[] { 8, 9, 10 }, 2); Assert.assertTrue(Arrays.equals(new byte[] { 4, 5, 6, 7, 8, 9 }, bytes)); }