/** * Skips over any property information that may precede a piece table. * These property structures contain stylesheet information that applies * to the piece table. Since we're only interested in the text itself, * we just ignore this property stuff. (I suppose a third buffered * stream could be used to add style information to {@link Piece}, but * we don't need it.) * * @param input the input stream containing the piece table * @throws IOException if an IO error occurs */ private static void skipProperties(SeekInputStream input) throws IOException { int tag = input.read(); while (tag == 1) { int size = Endian.littleChar(input); while (size > 0) { size -= input.skip(size); } tag = input.read(); } if (tag != 2) { throw new IllegalStateException(); } }
@Override public long skip(long count) throws IOException { return input.skip(count); }
@Override public long skip(long count) throws IOException { return input.skip(count); }
@Override public long skip(long count) throws IOException { return input.skip(count); }
@Override public long skip(long c) throws IOException { ensure(); long r = input.skip(c); if (r > 0) { expected += r; } return r; }
@Override public long skip(long c) throws IOException { ensure(); long r = input.skip(c); if (r > 0) { expected += r; } return r; }
@Override public long skip(long c) throws IOException { ensure(); long r = input.skip(c); if (r > 0) { expected += r; } return r; }
/** * Skips over any property information that may precede a piece table. * These property structures contain stylesheet information that applies * to the piece table. Since we're only interested in the text itself, * we just ignore this property stuff. (I suppose a third buffered * stream could be used to add style information to {@link Piece}, but * we don't need it.) * * @param input the input stream containing the piece table * @throws IOException if an IO error occurs */ private static void skipProperties(SeekInputStream input) throws IOException { int tag = input.read(); while (tag == 1) { int size = Endian.littleChar(input); while (size > 0) { size -= input.skip(size); } tag = input.read(); } if (tag != 2) { throw new IllegalStateException(); } }