code: @Override
      public ProtoNetworkDescriptor writeProtoNetwork(ProtoNetwork protoNetwork,
              String protoNetworkRootPath) throws ProtoNetworkError {
          final String filename = PROTO_NETWORK_FILENAME;
          final File file = new File(asPath(protoNetworkRootPath, filename));
  
          ObjectOutputStream oos = null;
          try {
              oos = new ObjectOutputStream(new FileOutputStream(file));
              protoNetwork.writeExternal(oos);
              return new BinaryProtoNetworkDescriptor(file);
          } catch (IOException e) {
              final String name = file.getAbsolutePath();
              final String msg =
                      "Cannot create temporary binary file for proto-network";
              throw new ProtoNetworkError(name, msg, e);
          } finally {
              // clean up IO resources
              IOUtils.closeQuietly(oos);
          }
      }
docs: Writes a binary-based proto network and produces a descriptor including
  the binary file.
  
  @param protoNetwork {@link ProtoNetwork}, the proto network, which cannot
  be null
  @param protoNetworkRootPath {@link String}, the root path where proto
  network files should be created
  @return {@link ProtoNetworkDescriptor}, the proto network descriptor
  @throws ProtoNetworkError, if there was an error writing the
  {@link ProtoNetwork}