@Test public void testUninterpret() throws Exception { byte[] b = new byte[] {49, 50, 51}; assertEquals("123", inter.uninterpret(b, 0, 3)); }
@Override public String uninterpret (byte[] rawData, int offset, int length) { byte[] ret = new byte[length]; try { System.arraycopy(rawData, offset, ret, 0, length); return new String(ret, ISOUtil.CHARSET); } catch (IndexOutOfBoundsException e) { throw new RuntimeException( String.format("Required %d but just got %d bytes", length, rawData.length-offset) ); } }
AsciiInterpreter implements Interpreter { @Override public String uninterpret (byte[] rawData, int offset, int length) { byte[] ret = new byte[length]; try { System.arraycopy(rawData, offset, ret, 0, length); return new String(ret, ISOUtil.CHARSET); } catch (IndexOutOfBoundsException e) { throw new RuntimeException( String.format("Required %d but just got %d bytes", length, rawData.length-offset) ); } } }
AsciiInterpreter implements Interpreter { @Override public String uninterpret (byte[] rawData, int offset, int length) { byte[] ret = new byte[length]; try { System.arraycopy(rawData, offset, ret, 0, length); return new String(ret, ISOUtil.CHARSET); } catch (IndexOutOfBoundsException e) { throw new RuntimeException( String.format("Required %d but just got %d bytes", length, rawData.length-offset) ); } }  }
AsciiInterpreter implements Interpreter { @Override public String uninterpret (byte[] rawData, int offset, int length) { byte[] ret = new byte[length]; try { System.arraycopy(rawData, offset, ret, 0, length); return new String(ret, ISOUtil.CHARSET); } catch (IndexOutOfBoundsException e) { throw new RuntimeException( String.format("Required %d but just got %d bytes", length, rawData.length-offset) ); } }  @Override void interpret(String data, byte[] b, int offset); @Override String uninterpret(byte[] rawData, int offset, int length); @Override int getPackedLength(int nDataUnits); }
AsciiInterpreter implements Interpreter { @Override public String uninterpret (byte[] rawData, int offset, int length) { byte[] ret = new byte[length]; try { System.arraycopy(rawData, offset, ret, 0, length); return new String(ret, ISOUtil.CHARSET); } catch (IndexOutOfBoundsException e) { throw new RuntimeException( String.format("Required %d but just got %d bytes", length, rawData.length-offset) ); } }  @Override void interpret(String data, byte[] b, int offset); @Override String uninterpret(byte[] rawData, int offset, int length); @Override int getPackedLength(int nDataUnits); static final AsciiInterpreter INSTANCE; }