class NalStreamTokenizer {
        private static Logger LOG = LoggerFactory.getLogger(NalStreamTokenizer.class.getName());
        MyByteArrayOutputStream next = new MyByteArrayOutputStream();
        int pattern = 0;
        private InputStream inputStream;

        public NalStreamTokenizer(InputStream inputStream) {
            this.inputStream = inputStream;

        }

        public byte[] getNext() throws IOException {<FILL_FUNCTION_BODY>}


    }

            //System.err.println("getNext() called");
            if (LOG.isDebugEnabled()) {
                LOG.debug("getNext() called");
            }
            int c;


            while ((c = inputStream.read()) != -1) {
                if (!(pattern == 2 && c == 3)) {
                    next.write(c);


                    if (pattern == 0 && c == 0) {
                        pattern = 1;
                    } else if (pattern == 1 && c == 0) {
                        pattern = 2;
                    } else if (pattern == 2 && c == 0) {
                        byte[] s = next.toByteArrayLess3();
                        next.reset();
                        if (s != null) {
                            return s;
                        }
                    } else if (pattern == 2 && c == 1) {
                        byte[] s = next.toByteArrayLess3();
                        next.reset();
                        pattern = 0;
                        if (s != null) {
                            return s;
                        }
                    } else if (pattern != 0) {
                        pattern = 0;
                    }
                } else {
                    pattern = 0;
                }
            }
            byte[] s = next.toByteArray();
            next.reset();
            if (s.length > 0) {
                return s;
            } else {
                return null;
            }
        
<methods>public void <init>() ,public void close() throws java.io.IOException,public synchronized void configure() ,public java.lang.String getHandler() ,public java.lang.String getLanguage() ,public static org.mp4parser.streaming.input.h264.H264NalUnitHeader getNalUnitHeader(java.nio.ByteBuffer) ,public org.mp4parser.boxes.iso14496.part12.SampleDescriptionBox getSampleDescriptionBox() ,public long getTimescale() ,public void setFrametick(int) ,public void setTimescale(int) <variables>private static org.slf4j.Logger LOG,List<java.nio.ByteBuffer> buffered,boolean configured,org.mp4parser.streaming.input.h264.spspps.PictureParameterSet currentPictureParameterSet,org.mp4parser.streaming.input.h264.spspps.SeqParameterSet currentSeqParameterSet,List<org.mp4parser.streaming.StreamingSample> decFrameBuffer,List<org.mp4parser.streaming.StreamingSample> decFrameBuffer2,int frametick,org.mp4parser.streaming.input.h264.H264NalConsumingTrack.FirstVclNalDetector fvnd,int max_dec_frame_buffering,LinkedHashMap<java.lang.Integer,org.mp4parser.streaming.input.h264.spspps.PictureParameterSet> ppsIdToPps,LinkedHashMap<java.lang.Integer,java.nio.ByteBuffer> ppsIdToPpsBytes,org.mp4parser.streaming.input.h264.H264NalUnitHeader sliceNalUnitHeader,BlockingQueue<org.mp4parser.streaming.input.h264.spspps.SeqParameterSet> spsForConfig,LinkedHashMap<java.lang.Integer,org.mp4parser.streaming.input.h264.spspps.SeqParameterSet> spsIdToSps,LinkedHashMap<java.lang.Integer,java.nio.ByteBuffer> spsIdToSpsBytes,org.mp4parser.boxes.iso14496.part12.SampleDescriptionBox stsd,int timescale