@Test void decode() throws Exception { assertThat(getEncoder().decode(ENCODED_BYTES), equalTo(BYTES)); assertThat(getEncoder().decode(WRAPPED_ENCODED_BYTES), equalTo(BYTES)); }
@Override public byte[] decode(String input) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] inBytes = input.getBytes(); getEncoder().decode(inBytes, 0, inBytes.length, baos); baos.close(); return baos.toByteArray(); }
AbstractBinaryStringEncoder implements BinaryStringEncoder { @Override public byte[] decode(String input) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] inBytes = input.getBytes(); getEncoder().decode(inBytes, 0, inBytes.length, baos); baos.close(); return baos.toByteArray(); } }
AbstractBinaryStringEncoder implements BinaryStringEncoder { @Override public byte[] decode(String input) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] inBytes = input.getBytes(); getEncoder().decode(inBytes, 0, inBytes.length, baos); baos.close(); return baos.toByteArray(); }  }
AbstractBinaryStringEncoder implements BinaryStringEncoder { @Override public byte[] decode(String input) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] inBytes = input.getBytes(); getEncoder().decode(inBytes, 0, inBytes.length, baos); baos.close(); return baos.toByteArray(); }  @Override String encode(byte[] input); @Override String encode(byte[] input, int wrapAt); @Override String encode(byte[] input, int off, int len); @Override String encode(byte[] input, int off, int len, int wrapAt); @Override byte[] decode(String input); @Override FilterInputStream getDecoderInputStream(InputStream is); @Override FilterOutputStream getEncoderOutputStream(OutputStream os); @Override FilterOutputStream getEncoderOutputStream(OutputStream os, int wrapAt); }
AbstractBinaryStringEncoder implements BinaryStringEncoder { @Override public byte[] decode(String input) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] inBytes = input.getBytes(); getEncoder().decode(inBytes, 0, inBytes.length, baos); baos.close(); return baos.toByteArray(); }  @Override String encode(byte[] input); @Override String encode(byte[] input, int wrapAt); @Override String encode(byte[] input, int off, int len); @Override String encode(byte[] input, int off, int len, int wrapAt); @Override byte[] decode(String input); @Override FilterInputStream getDecoderInputStream(InputStream is); @Override FilterOutputStream getEncoderOutputStream(OutputStream os); @Override FilterOutputStream getEncoderOutputStream(OutputStream os, int wrapAt);  }