Package info.ata4.io

Examples of info.ata4.io.DataOutputWriter.writeInt()


        File dbFile = new File(FILENAME);
        try (BufferedOutputStream bos = new BufferedOutputStream(FileUtils.openOutputStream(dbFile))) {
            DataOutputWriter out = DataOutputWriter.newWriter(bos);
           
            // write header
            out.writeInt(VERSION);

            // write field node table
            Set<TypeField> fieldNodes = new HashSet<>(ftm.values());
            Map<TypeField, Integer> fieldNodeMap = new HashMap<>();
View Full Code Here


            // write field node table
            Set<TypeField> fieldNodes = new HashSet<>(ftm.values());
            Map<TypeField, Integer> fieldNodeMap = new HashMap<>();

            out.writeInt(fieldNodes.size());

            int index = 0;
            for (TypeField fieldNode : fieldNodes) {
                fieldNodeMap.put(fieldNode, index++);
                fieldNode.write(out);
View Full Code Here

            for (Map.Entry<Pair<Integer, UnityVersion>, TypeField> entry : ftm.entrySet()) {
                versions.add(entry.getKey().getRight());
            }

            out.writeInt(versions.size());

            index = 0;
            for (UnityVersion version : versions) {
                versionMap.put(version, index++);
                out.writeStringNull(version.toString());
View Full Code Here

                versionMap.put(version, index++);
                out.writeStringNull(version.toString());
            }

            // write mapping data
            out.writeInt(ftm.entrySet().size());

            for (Map.Entry<Pair<Integer, UnityVersion>, TypeField> entry : ftm.entrySet()) {
                index = fieldNodeMap.get(entry.getValue());
                Pair<Integer, UnityVersion> fieldNodeKey = entry.getKey();
View Full Code Here

                Pair<Integer, UnityVersion> fieldNodeKey = entry.getKey();

                int classID = fieldNodeKey.getLeft();
                UnityVersion version = fieldNodeKey.getRight();

                out.writeInt(index);
                out.writeInt(classID);
                out.writeInt(versionMap.get(version));
            }
        } catch (IOException ex) {
            L.log(Level.SEVERE, "Can't write struct database", ex);
View Full Code Here

                int classID = fieldNodeKey.getLeft();
                UnityVersion version = fieldNodeKey.getRight();

                out.writeInt(index);
                out.writeInt(classID);
                out.writeInt(versionMap.get(version));
            }
        } catch (IOException ex) {
            L.log(Level.SEVERE, "Can't write struct database", ex);
        }
View Full Code Here

                int classID = fieldNodeKey.getLeft();
                UnityVersion version = fieldNodeKey.getRight();

                out.writeInt(index);
                out.writeInt(classID);
                out.writeInt(versionMap.get(version));
            }
        } catch (IOException ex) {
            L.log(Level.SEVERE, "Can't write struct database", ex);
        }
    }
View Full Code Here

        // allocate data buffer
        ByteBuffer bbData = ByteBuffer.allocateDirect(bundleDataOffset + bundleDataSize);
        DataOutputWriter out = DataOutputWriter.newWriter(bbData.duplicate());
       
        // write bundle entries
        out.writeInt(entrySet.size());
        for (Map.Entry<String, ByteBuffer> entry : entrySet) {
            String name = entry.getKey();
            ByteBuffer buffer = entry.getValue();
            buffer.rewind();
           
View Full Code Here

            String name = entry.getKey();
            ByteBuffer buffer = entry.getValue();
            buffer.rewind();
           
            out.writeStringNull(name);
            out.writeInt(bundleDataOffset);
            out.writeInt(buffer.limit());
           
            bbData.position(bundleDataOffset);
            bbData.put(buffer);
           
View Full Code Here

            ByteBuffer buffer = entry.getValue();
            buffer.rewind();
           
            out.writeStringNull(name);
            out.writeInt(bundleDataOffset);
            out.writeInt(buffer.limit());
           
            bbData.position(bundleDataOffset);
            bbData.put(buffer);
           
            bundleDataOffset += align(buffer.limit());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.