FileEntry extends VirtualFileEntry { public InputStream getInputStream() throws IOException, ServerException { return getContentStream().getStream(); } FileEntry(String workspace, VirtualFile virtualFile); @Override FileEntry copyTo(String newParent); @Override FileEntry copyTo(String newParent, String newName, boolean override); @Override void moveTo(String newParent); @Override void moveTo(String newParent, String name, boolean overWrite); String getMediaType(); void setMediaType(String mediaType); InputStream getInputStream(); byte[] contentAsBytes(); void updateContent(byte[] content, String mediaType); void updateContent(byte[] content); void updateContent(InputStream content); void updateContent(InputStream content, String mediaType); void rename(String newName, String newMediaType);  }
@Test public void testGetContentAsStream() throws Exception { byte[] buf; try (InputStream inputStream = myFile.getInputStream()) { buf = ByteStreams.toByteArray(inputStream); } Assert.assertEquals(buf, "to be or not to be".getBytes()); }