Java 类com.intellij.util.io.UnsyncByteArrayOutputStream 实例源码

项目:intellij-ce-playground    文件:StreamUtil.java   
public static byte[] loadFromStream(InputStream inputStream) throws IOException {
  final UnsyncByteArrayOutputStream outputStream = new UnsyncByteArrayOutputStream();
  try {
    copyStreamContent(inputStream, outputStream);
  }
  finally {
    inputStream.close();
  }
  return outputStream.toByteArray();
}
项目:consulo    文件:ExternalStorage.java   
public void saveContent(@Nonnull String fileSpec, @Nonnull RoamingType roamingType, byte[] content, int size) throws IOException {
  UnsyncByteArrayOutputStream out = new UnsyncByteArrayOutputStream(size);
  try (SnappyOutputStream snappyOutputStream = new SnappyOutputStream(out)) {
    snappyOutputStream.write(content, 0, size);
  }

  byte[] compressedContent = out.toByteArray();

  myQueue.wantSave(myProxyDirectory, fileSpec, roamingType, compressedContent);
}
项目:consulo    文件:StreamUtil.java   
public static byte[] loadFromStream(InputStream inputStream) throws IOException {
  final UnsyncByteArrayOutputStream outputStream = new UnsyncByteArrayOutputStream();
  try {
    copyStreamContent(inputStream, outputStream);
  }
  finally {
    inputStream.close();
  }
  return outputStream.toByteArray();
}