static FileSystemNode readNode(int id, Node parent, ScrollingBuffer buf) throws IOException { // offset int offset = buf.getInt(); double x1; double y1; double x2; double y2; // envelope x1 = buf.getDouble(); y1 = buf.getDouble(); x2 = buf.getDouble(); y2 = buf.getDouble(); Envelope env = new Envelope(x1, x2, y1, y2); // shapes in this node int numShapesId = buf.getInt(); int[] ids = new int[numShapesId]; buf.getIntArray(ids); int numSubNodes = buf.getInt(); // let's create the new node FileSystemNode node = new FileSystemNode(env, id, parent, buf, (int) buf.getPosition(), offset); node.setShapesId(ids); node.setNumSubNodes(numSubNodes); return node; }
static FileSystemNode readNode(int id, Node parent, ScrollingBuffer buf) throws IOException { // offset int offset = buf.getInt(); // envelope Envelope env = buf.getEnvelope(); // shapes in this node int numShapesId = buf.getInt(); int[] ids = null; if(numShapesId > 0) { ids = new int[numShapesId]; buf.getIntArray(ids); } else { ids = ZERO; } int numSubNodes = buf.getInt(); // let's create the new node FileSystemNode node = new FileSystemNode(env, buf, (int) buf.getPosition(), offset); node.setShapesId(ids); node.setNumSubNodes(numSubNodes); return node; }
static FileSystemNode readNode(int id, Node parent, ScrollingBuffer buf) throws IOException { // offset int offset = buf.getInt(); // envelope Envelope env = buf.getEnvelope(); // shapes in this node int numShapesId = buf.getInt(); int[] ids = null; if(numShapesId > 0) { ids = new int[numShapesId]; buf.getIntArray(ids); } else { ids = ZERO; } int numSubNodes = buf.getInt(); // let's create the new node FileSystemNode node = new FileSystemNode(env, buf, (int) buf.getPosition(), offset); node.setShapesId(ids); node.setNumSubNodes(numSubNodes); return node; }