/** * Skips the encoded console note. */ public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble,PREAMBLE)) return; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int macSz = - decoded.readInt(); if (macSz > 0) { // new format IOUtils.skip(decoded, macSz); int sz = decoded.readInt(); IOUtils.skip(decoded, sz); } else { // old format int sz = -macSz; IOUtils.skip(decoded, sz); } byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); }
@Override public long skip(long n) throws IOException { long r=0; while (n>0) { int ch = read(); if (ch<0) break; n--; r++; } return r; } }
@Override public int read(byte[] b, int off, int len) throws IOException { int i; for (i=0; i<len; i++) { int ch = read(); if (ch<0) break; b[off+i] = (byte)ch; } return i==0 ? -1 : i; }
return null; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int macSz = - decoded.readInt(); byte[] mac;
@Override public long skip(long n) throws IOException { long r=0; while (n>0) { int ch = read(); if (ch<0) break; n--; r++; } return r; } }
/** * Skips the encoded console note. */ public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble,PREAMBLE)) return; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt(); IOUtils.skip(decoded,sz); byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); }
@Override public long skip(long n) throws IOException { long r=0; while (n>0) { int ch = read(); if (ch<0) break; n--; r++; } return r; } }
/** * Skips the encoded console note. */ public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble,PREAMBLE)) return; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt(); IOUtils.skip(decoded,sz); byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); }
@Override public int read(byte[] b, int off, int len) throws IOException { int i; for (i=0; i<len; i++) { int ch = read(); if (ch<0) break; b[off+i] = (byte)ch; } return i==0 ? -1 : i; }
/** * Skips the encoded console note. */ public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble,PREAMBLE)) return; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt(); IOUtils.skip(decoded,sz); byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); }
@Override public long skip(long n) throws IOException { long r=0; while (n>0) { int ch = read(); if (ch<0) break; n--; r++; } return r; } }
/** * Skips the encoded console note. */ public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble, PREAMBLE)) { return; // not a valid preamble } DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt(); IOUtils.skip(decoded, sz); byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); } private static final long serialVersionUID = 1L;
@Override public int read(byte[] b, int off, int len) throws IOException { int i; for (i=0; i<len; i++) { int ch = read(); if (ch<0) break; b[off+i] = (byte)ch; } return i==0 ? -1 : i; }
/** * Skips the encoded console note. */ public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble,PREAMBLE)) return; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int macSz = - decoded.readInt(); if (macSz > 0) { // new format IOUtils.skip(decoded, macSz); int sz = decoded.readInt(); IOUtils.skip(decoded, sz); } else { // old format int sz = -macSz; IOUtils.skip(decoded, sz); } byte[] postamble = new byte[POSTAMBLE.length]; in.readFully(postamble); }
@Override public long skip(long n) throws IOException { long r=0; while (n>0) { int ch = read(); if (ch<0) break; n--; r++; } return r; } }
return null; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt();
@Override public int read(byte[] b, int off, int len) throws IOException { int i; for (i = 0; i < len; i++) { int ch = read(); if (ch < 0) { break; } b[off + i] = (byte) ch; } return i == 0 ? -1 : i; }
return null; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt();
@Override public int read(byte[] b, int off, int len) throws IOException { int i; for (i=0; i<len; i++) { int ch = read(); if (ch<0) break; b[off+i] = (byte)ch; } return i==0 ? -1 : i; }
return null; // not a valid preamble DataInputStream decoded = new DataInputStream(new UnbufferedBase64InputStream(in)); int sz = decoded.readInt();