### Question:
BinaryReader { public String readAndBase64EncodeBinary(int length) { return Base64.getEncoder().encodeToString(readBytes(length)); } BinaryReader(BinaryReader binaryReader, int position);  BinaryReader(InputStream inputStream, int size);  BinaryReader(byte[] bytes); int read(); int peek(); byte[] peekBytes(int length); byte[] readBytes(int length); void readBytes(byte[] buf, int offset, int length); String readGuid(); String readString(int length); String readWString(int length); UnsignedLong readQWord(); UnsignedInteger readDWord(); UnsignedInteger readDWordBE(); int readWord(); int readWordBE(); Date readFileTime(); String readAndBase64EncodeBinary(int length); void skip(int bytes); int getPosition(); byte[] getBytes(); static final long EPOCH_OFFSET; static final int[][] INDEX_ARRAYS; }### Answer:
@Test public void testReadAndBase64EncodeBinary() throws IOException { String orig = "Hello World"; String stringValue = Base64.getEncoder().encodeToString(orig.getBytes(Charsets.US_ASCII)); BinaryReader binaryReader = testBinaryReaderBuilder.putBase64EncodedBinary(stringValue).build(); assertEquals(stringValue, binaryReader.readAndBase64EncodeBinary(orig.length())); assertEquals(orig.length(), binaryReader.getPosition()); }