@@ -0,0 +1,2250 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.pdfbox.pdfparser;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0A%0Aimport java.io.IOException;%0Aimport java.io.OutputStream;%0Aimport java.util.Map;%0A%0Aimport org.apache.pdfbox.cos.COSBoolean;%0Aimport org.apache.pdfbox.cos.COSInteger;%0Aimport org.apache.pdfbox.cos.COSName;%0Aimport org.apache.pdfbox.cos.COSStream;%0Aimport org.junit.jupiter.api.Test;%0A%0A/**%0A * Test for PDFObjectStreamParser.%0A */%0Apublic class PDFObjectStreamParserTest%0A%7B%0A    @Test%0A    public void testOffsetParsing() throws IOException%0A    %7B%0A        COSStream stream = new COSStream();%0A        stream.setItem(COSName.N, COSInteger.TWO);%0A        stream.setItem(COSName.FIRST, COSInteger.get(8));%0A        OutputStream outputStream = stream.createOutputStream();%0A        outputStream.write(%221 0 2 5 true false%22.getBytes());%0A        outputStream.close();%0A        PDFObjectStreamParser objectStreamParser = new PDFObjectStreamParser(stream, null);%0A        Map%3CLong, Integer%3E objectNumbers = objectStreamParser.readObjectNumbers();%0A        assertEquals(2, objectNumbers.size());%0A        Long%5B%5D numbers = objectNumbers.keySet().toArray(new Long%5B0%5D);%0A        objectStreamParser = new PDFObjectStreamParser(stream, null);%0A        assertEquals(COSBoolean.TRUE, objectStreamParser.parseObject(numbers%5B0%5D));%0A        objectStreamParser = new PDFObjectStreamParser(stream, null);%0A        assertEquals(COSBoolean.FALSE, objectStreamParser.parseObject(numbers%5B1%5D));%0A    %7D%0A%7D%0A

add test from 2.0 branch