protected Node readNode(BufferedInputStreamWrapper nodesFileStream) throws IOException { int nodeId = nodesFileStream.readInt(); int perimeter = nodesFileStream.readInt(); int area = nodesFileStream.readInt(); int upperLeftX = nodesFileStream.readInt(); int upperLeftY = nodesFileStream.readInt(); int width = nodesFileStream.readInt(); int height = nodesFileStream.readInt(); BoundingBox box = new BoundingBox(upperLeftX, upperLeftY, width, height); int contourSize = nodesFileStream.readInt(); int byteCount = nodesFileStream.readInt(); byte[] bits = new byte[byteCount]; nodesFileStream.readFully(bits); Contour contour = new Contour(contourSize, bits); int numberOfComponentsPerPixel = nodesFileStream.readInt(); return buildNode(nodeId, box, contour, perimeter, area, numberOfComponentsPerPixel); }