1 package com.sun.org.apache.bcel.internal.util; 2 3 56 import java.io.*; 57 58 66 public final class ByteSequence extends DataInputStream { 67 private ByteArrayStream byte_stream; 68 69 public ByteSequence(byte[] bytes) { 70 super(new ByteArrayStream(bytes)); 71 byte_stream = (ByteArrayStream)in; 72 } 73 74 public final int getIndex() { return byte_stream.getPosition(); } 75 final void unreadByte() { byte_stream.unreadByte(); } 76 77 private static final class ByteArrayStream extends ByteArrayInputStream { 78 ByteArrayStream(byte[] bytes) { super(bytes); } 79 final int getPosition() { return pos; } final void unreadByte() { if(pos > 0) pos--; } 81 } 82 } 83 | Popular Tags |