Package com.google.common.io

Examples of com.google.common.io.ByteArrayDataInput


    write(dataOutput, tx.getInProgress());
    write(dataOutput, tx.getInvalids());
  }

  private static Transaction bytesToTx(byte[] bytes) throws IOException {
    ByteArrayDataInput dataInput = ByteStreams.newDataInput(bytes);
    return readTx(dataInput);
  }
View Full Code Here


    }

    @Override
    public Iterator<Message> iterator() {
        try {
            final ByteArrayDataInput input = ByteStreams.newDataInput(
                    Compression.create(messageSet.getCompression()).decompress(messageSet.getMessages()));

            return new Iterator<Message>() {
                private int messageCount = messageSet.getNumMessages();
View Full Code Here

    }

    private ClassPatch readPatch(JarEntry patchEntry, JarInputStream jis)
    {
        FMLRelaunchLog.finer("Reading patch data from %s", patchEntry.getName());
        ByteArrayDataInput input;
        try
        {
            input = ByteStreams.newDataInput(ByteStreams.toByteArray(jis));
        }
        catch (IOException e)
        {
            FMLRelaunchLog.log(Level.WARN, e, "Unable to read binpatch file %s - ignoring", patchEntry.getName());
            return null;
        }
        String name = input.readUTF();
        String sourceClassName = input.readUTF();
        String targetClassName = input.readUTF();
        boolean exists = input.readBoolean();
        int inputChecksum = 0;
        if (exists)
        {
            inputChecksum = input.readInt();
        }
        int patchLength = input.readInt();
        byte[] patchBytes = new byte[patchLength];
        input.readFully(patchBytes);

        return new ClassPatch(name, sourceClassName, targetClassName, exists, inputChecksum, patchBytes);
    }
View Full Code Here

TOP

Related Classes of com.google.common.io.ByteArrayDataInput

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.