Example usage for com.google.common.io ByteBufferDataInputStream ByteBufferDataInputStream

List of usage examples for com.google.common.io ByteBufferDataInputStream ByteBufferDataInputStream

Introduction

In this page you can find the example usage for com.google.common.io ByteBufferDataInputStream ByteBufferDataInputStream.

Prototype

public ByteBufferDataInputStream(ByteBuffer buf) 

Source Link

Usage

From source file:ch.ledcom.jpreseed.UsbCreator.java

private ByteBuffer repackedInitrd(ByteBuffer srcInitrdGz, Collection<Path> preseedFiles) throws IOException {
    ByteArrayOutputStream newInitrd = new ByteArrayOutputStream();
    InitrdRepacker initrdRepacker = new InitrdRepacker(new ByteBufferDataInputStream(srcInitrdGz));
    for (Path preseedFile : preseedFiles) {
        initrdRepacker.addFile(preseedFile.getFileName().toString(), preseedFile.toFile());
    }// w  w w . j a v a2s  . co  m
    initrdRepacker.repack(newInitrd);

    return ByteBuffer.wrap(newInitrd.toByteArray());
}