@Test public void testRead2() throws Throwable { FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath", "testFSDMsgBaseSchema"); String result = fSDMsg.read(is, 0, "2C", null); assertEquals("", result, "result"); }
protected String read (InputStreamReader r, int len, String type, String separator) throws IOException { StringBuilder sb = new StringBuilder(); char[] c = new char[1]; boolean expectSeparator = isSeparated(separator); boolean separated = expectSeparator; char separatorChar= expectSeparator ? getSeparator(separator) : '\0'; if (EOM_SEPARATOR.equals(separator)) { char[] rest = new char[32]; int con; while ((con = r.read(rest, 0, rest.length)) >= 0) { readCount += con; if (rest.length == con) sb.append(rest); else sb.append(Arrays.copyOf(rest, con)); } } else if (isDummySeparator(separator)) { for (int i = 0; i < len; i++) { if (r.read(c) < 0) { break; } readCount++; sb.append(c[0]); } } else { int lengthLength = 0; if (type != null && type.startsWith("L")) { while (type.charAt(0) == 'L') { lengthLength++; type = type.substring(1); } if (lengthLength > 0) { char[] ll = new char[lengthLength]; if (r.read(ll) != lengthLength) throw new EOFException(); len = Integer.parseInt(new String(ll)); } } for (int i = 0; i < len; i++) { if (r.read(c) < 0) { if (!"EOF".equals(separator)) throw new EOFException(); else { separated = false; break; } } readCount++; if (expectSeparator && c[0] == separatorChar) { separated = false; break; } sb.append(c[0]); } if (separated && !"EOF".equals(separator)) { if (r.read(c) < 0) { throw new EOFException(); } else { readCount++; } } } return sb.toString(); }
FSDMsg implements Loggeable, Cloneable { protected String read (InputStreamReader r, int len, String type, String separator) throws IOException { StringBuilder sb = new StringBuilder(); char[] c = new char[1]; boolean expectSeparator = isSeparated(separator); boolean separated = expectSeparator; char separatorChar= expectSeparator ? getSeparator(separator) : '\0'; if (EOM_SEPARATOR.equals(separator)) { char[] rest = new char[32]; int con; while ((con = r.read(rest, 0, rest.length)) >= 0) { readCount += con; if (rest.length == con) sb.append(rest); else sb.append(Arrays.copyOf(rest, con)); } } else if (isDummySeparator(separator)) { for (int i = 0; i < len; i++) { if (r.read(c) < 0) { break; } readCount++; sb.append(c[0]); } } else { int lengthLength = 0; if (type != null && type.startsWith("L")) { while (type.charAt(0) == 'L') { lengthLength++; type = type.substring(1); } if (lengthLength > 0) { char[] ll = new char[lengthLength]; if (r.read(ll) != lengthLength) throw new EOFException(); len = Integer.parseInt(new String(ll)); } } for (int i = 0; i < len; i++) { if (r.read(c) < 0) { if (!"EOF".equals(separator)) throw new EOFException(); else { separated = false; break; } } readCount++; if (expectSeparator && c[0] == separatorChar) { separated = false; break; } sb.append(c[0]); } if (separated && !"EOF".equals(separator)) { if (r.read(c) < 0) { throw new EOFException(); } else { readCount++; } } } return sb.toString(); } }
FSDMsg implements Loggeable, Cloneable { protected String read (InputStreamReader r, int len, String type, String separator) throws IOException { StringBuilder sb = new StringBuilder(); char[] c = new char[1]; boolean expectSeparator = isSeparated(separator); boolean separated = expectSeparator; char separatorChar= expectSeparator ? getSeparator(separator) : '\0'; if (EOM_SEPARATOR.equals(separator)) { char[] rest = new char[32]; int con; while ((con = r.read(rest, 0, rest.length)) >= 0) { readCount += con; if (rest.length == con) sb.append(rest); else sb.append(Arrays.copyOf(rest, con)); } } else if (isDummySeparator(separator)) { for (int i = 0; i < len; i++) { if (r.read(c) < 0) { break; } readCount++; sb.append(c[0]); } } else { int lengthLength = 0; if (type != null && type.startsWith("L")) { while (type.charAt(0) == 'L') { lengthLength++; type = type.substring(1); } if (lengthLength > 0) { char[] ll = new char[lengthLength]; if (r.read(ll) != lengthLength) throw new EOFException(); len = Integer.parseInt(new String(ll)); } } for (int i = 0; i < len; i++) { if (r.read(c) < 0) { if (!"EOF".equals(separator)) throw new EOFException(); else { separated = false; break; } } readCount++; if (expectSeparator && c[0] == separatorChar) { separated = false; break; } sb.append(c[0]); } if (separated && !"EOF".equals(separator)) { if (r.read(c) < 0) { throw new EOFException(); } else { readCount++; } } } return sb.toString(); } FSDMsg(String basePath);  FSDMsg(String basePath, String baseSchema); }
FSDMsg implements Loggeable, Cloneable { protected String read (InputStreamReader r, int len, String type, String separator) throws IOException { StringBuilder sb = new StringBuilder(); char[] c = new char[1]; boolean expectSeparator = isSeparated(separator); boolean separated = expectSeparator; char separatorChar= expectSeparator ? getSeparator(separator) : '\0'; if (EOM_SEPARATOR.equals(separator)) { char[] rest = new char[32]; int con; while ((con = r.read(rest, 0, rest.length)) >= 0) { readCount += con; if (rest.length == con) sb.append(rest); else sb.append(Arrays.copyOf(rest, con)); } } else if (isDummySeparator(separator)) { for (int i = 0; i < len; i++) { if (r.read(c) < 0) { break; } readCount++; sb.append(c[0]); } } else { int lengthLength = 0; if (type != null && type.startsWith("L")) { while (type.charAt(0) == 'L') { lengthLength++; type = type.substring(1); } if (lengthLength > 0) { char[] ll = new char[lengthLength]; if (r.read(ll) != lengthLength) throw new EOFException(); len = Integer.parseInt(new String(ll)); } } for (int i = 0; i < len; i++) { if (r.read(c) < 0) { if (!"EOF".equals(separator)) throw new EOFException(); else { separated = false; break; } } readCount++; if (expectSeparator && c[0] == separatorChar) { separated = false; break; } sb.append(c[0]); } if (separated && !"EOF".equals(separator)) { if (r.read(c) < 0) { throw new EOFException(); } else { readCount++; } } } return sb.toString(); } FSDMsg(String basePath);  FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(String separatorName, char separator); void unsetSeparator(String separatorName); void unpack(InputStream is); void unpack(byte[] b); String pack(); byte[] packToBytes(); boolean isSeparator(byte b); void set(String name, String value); void setHeader(byte[] h); byte[] getHeader(); String getHexHeader(); String get(String fieldName); String get(String fieldName, String def); void copy(String fieldName, FSDMsg msg); void copy(String fieldName, FSDMsg msg, String def); byte[] getHexBytes(String name); @SuppressWarnings("PMD.EmptyCatchBlock") int getInt(String name); @SuppressWarnings("PMD.EmptyCatchBlock") int getInt(String name, int def); Element toXML(); Map getMap(); void setMap(Map fields); @Override void dump(PrintStream p, String indent); boolean hasField(String fieldName); @Override Object clone(); void merge(FSDMsg m); @Override boolean equals(Object o); @Override int hashCode(); }
FSDMsg implements Loggeable, Cloneable { protected String read (InputStreamReader r, int len, String type, String separator) throws IOException { StringBuilder sb = new StringBuilder(); char[] c = new char[1]; boolean expectSeparator = isSeparated(separator); boolean separated = expectSeparator; char separatorChar= expectSeparator ? getSeparator(separator) : '\0'; if (EOM_SEPARATOR.equals(separator)) { char[] rest = new char[32]; int con; while ((con = r.read(rest, 0, rest.length)) >= 0) { readCount += con; if (rest.length == con) sb.append(rest); else sb.append(Arrays.copyOf(rest, con)); } } else if (isDummySeparator(separator)) { for (int i = 0; i < len; i++) { if (r.read(c) < 0) { break; } readCount++; sb.append(c[0]); } } else { int lengthLength = 0; if (type != null && type.startsWith("L")) { while (type.charAt(0) == 'L') { lengthLength++; type = type.substring(1); } if (lengthLength > 0) { char[] ll = new char[lengthLength]; if (r.read(ll) != lengthLength) throw new EOFException(); len = Integer.parseInt(new String(ll)); } } for (int i = 0; i < len; i++) { if (r.read(c) < 0) { if (!"EOF".equals(separator)) throw new EOFException(); else { separated = false; break; } } readCount++; if (expectSeparator && c[0] == separatorChar) { separated = false; break; } sb.append(c[0]); } if (separated && !"EOF".equals(separator)) { if (r.read(c) < 0) { throw new EOFException(); } else { readCount++; } } } return sb.toString(); } FSDMsg(String basePath);  FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(String separatorName, char separator); void unsetSeparator(String separatorName); void unpack(InputStream is); void unpack(byte[] b); String pack(); byte[] packToBytes(); boolean isSeparator(byte b); void set(String name, String value); void setHeader(byte[] h); byte[] getHeader(); String getHexHeader(); String get(String fieldName); String get(String fieldName, String def); void copy(String fieldName, FSDMsg msg); void copy(String fieldName, FSDMsg msg, String def); byte[] getHexBytes(String name); @SuppressWarnings("PMD.EmptyCatchBlock") int getInt(String name); @SuppressWarnings("PMD.EmptyCatchBlock") int getInt(String name, int def); Element toXML(); Map getMap(); void setMap(Map fields); @Override void dump(PrintStream p, String indent); boolean hasField(String fieldName); @Override Object clone(); void merge(FSDMsg m); @Override boolean equals(Object o); @Override int hashCode(); static char FS; static char US; static char GS; static char RS; static char EOF; static char PIPE; static char EOM; }