Package com.netflix.zeno.fastblob.io

Examples of com.netflix.zeno.fastblob.io.FastBlobHeader


    /**
     * Read a snapshot from the specified stream.  Apply the snapshot to the FastBlobStateEngine supplied in the constructor of this class.
     */
    public void readSnapshot(InputStream is) throws IOException {
        FastBlobHeader header = readHeader(is);

        StreamingByteData byteData = getStreamingByteData(is, header.getDeserializationBufferSizeHint());
        DataInputStream dis = new DataInputStream(byteData);

        int numTypes = header.getNumberOfTypes();

        if(stateEngine.getLatestVersion() == null) {
            readSnapshotTypes(byteData, dis, numTypes);
        }

        ///The version must be set *after* the changes are applied.  This will protect against
        ///bad data in the event of an Exception midway through parsing.
        stateEngine.setLatestVersion(header.getVersion());
    }
View Full Code Here


    /**
     * Read the header and return the version
     */
    private FastBlobHeader readHeader(InputStream is) throws IOException {
        FastBlobHeader header = headerReader.readHeader(is);
        stateEngine.addHeaderTags(header.getHeaderTags());
        return header;
    }
View Full Code Here

TOP

Related Classes of com.netflix.zeno.fastblob.io.FastBlobHeader

Copyright © 2018 www.massapicom. 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.