Code example for ByteArrayDataOutput

Methods: toByteArray

0
import java.io.IOException;
 
public class JournalUtil { 
  public static byte[] locationToBytes(Location location) throws IOException {
    ByteArrayDataOutput dos = ByteStreams.newDataOutput();
    location.writeExternal(dos);
    return dos.toByteArray();
  } 
 
  public static Journal createJournal(String dirPath, int fileSize, int writeBatchSize) {
    Journal journal = new Journal();
    File directory = new File(dirPath);
    //noinspection ResultOfMethodCallIgnored 
    directory.mkdirs();
    journal.setDirectory(directory);
    journal.setMaxFileLength(fileSize);
    journal.setMaxWriteBatchSize(writeBatchSize);
 
    try { 
      journal.open();
Connect your IDE to all the code out there  Get Codota for Java