test_class.declarator: testContent = "to be or not to be".getBytes()
test_class.modifier: private
test_class.original_string: private byte[] testContent = "to be or not to be".getBytes();
test_class.type: byte[]
test_class.var_name: testContent
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private ApplicationContext context;
test_class.type: ApplicationContext
test_class.var_name: context
test_class.declarator: dataSourceEntityProvider
test_class.modifier: private
test_class.original_string: private DataSourceEntityProvider dataSourceEntityProvider;
test_class.type: DataSourceEntityProvider
test_class.var_name: dataSourceEntityProvider
test_class.file: everrest-core/src/test/java/org/everrest/core/impl/provider/DataSourceEntityProviderTest.java
test_class.identifier: DataSourceEntityProviderTest
test_case.body: @Test
      public void writesFileToOutputStream() throws Exception {
          ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource(testContent, TEXT_PLAIN);
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          MultivaluedHashMap<String, Object> headers = new MultivaluedHashMap<>();
  
          dataSourceEntityProvider.writeTo(byteArrayDataSource, DataSource.class, null, null, null, headers, out);
  
          assertArrayEquals(testContent, out.toByteArray());
          assertEquals(TEXT_PLAIN, headers.getFirst(CONTENT_TYPE));
      }
test_case.class_method_signature: DataSourceEntityProviderTest.writesFileToOutputStream()
test_case.full_signature: @Test public void writesFileToOutputStream()
test_case.identifier: writesFileToOutputStream
test_case.invocations: writeTo assertArrayEquals toByteArray assertEquals getFirst
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void writesFileToOutputStream()
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/provider/DataSourceEntityProvider.java
focal_class.identifier: DataSourceEntityProvider
focal_class.interfaces: implements EntityProvider<DataSource>
focal_class.class_method_signature: DataSourceEntityProvider.isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.full_signature: @Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.identifier: isReadable
focal_class.modifiers: @Override public
focal_class.parameters: (Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.return: boolean
focal_class.signature: boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.class_method_signature: DataSourceEntityProvider.readFrom(Class<DataSource> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 MediaType mediaType,
                                 MultivaluedMap<String, String> httpHeaders,
                                 InputStream entityStream)
focal_class.full_signature: @Override public DataSource readFrom(Class<DataSource> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 MediaType mediaType,
                                 MultivaluedMap<String, String> httpHeaders,
                                 InputStream entityStream)
focal_class.identifier: readFrom
focal_class.modifiers: @Override public
focal_class.parameters: (Class<DataSource> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 MediaType mediaType,
                                 MultivaluedMap<String, String> httpHeaders,
                                 InputStream entityStream)
focal_class.return: DataSource
focal_class.signature: DataSource readFrom(Class<DataSource> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 MediaType mediaType,
                                 MultivaluedMap<String, String> httpHeaders,
                                 InputStream entityStream)
focal_class.class_method_signature: DataSourceEntityProvider.getSize(DataSource dataSource, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.full_signature: @Override public long getSize(DataSource dataSource, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.identifier: getSize
focal_class.modifiers: @Override public
focal_class.parameters: (DataSource dataSource, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.return: long
focal_class.signature: long getSize(DataSource dataSource, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.class_method_signature: DataSourceEntityProvider.isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.full_signature: @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.identifier: isWriteable
focal_class.modifiers: @Override public
focal_class.parameters: (Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.return: boolean
focal_class.signature: boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
focal_class.class_method_signature: DataSourceEntityProvider.writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.full_signature: @Override public void writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.identifier: writeTo
focal_class.modifiers: @Override public
focal_class.parameters: (DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.return: void
focal_class.signature: void writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_class.class_method_signature: DataSourceEntityProvider.createDataSource(InputStream entityStream, String mimeType)
focal_class.full_signature: private DataSource createDataSource(InputStream entityStream, String mimeType)
focal_class.identifier: createDataSource
focal_class.modifiers: private
focal_class.parameters: (InputStream entityStream, String mimeType)
focal_class.return: DataSource
focal_class.signature: DataSource createDataSource(InputStream entityStream, String mimeType)
focal_method.body: @Override
      public void writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream) throws IOException {
          if (httpHeaders.getFirst(CONTENT_TYPE) == null && !isNullOrEmpty(dataSource.getContentType())) {
              httpHeaders.putSingle(CONTENT_TYPE, dataSource.getContentType());
          }
          try (InputStream in = dataSource.getInputStream()) {
              ByteStreams.copy(in, entityStream);
          }
      }
focal_method.class_method_signature: DataSourceEntityProvider.writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_method.full_signature: @Override public void writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_method.identifier: writeTo
focal_method.invocations: getFirst isNullOrEmpty getContentType putSingle getContentType getInputStream copy
focal_method.modifiers: @Override public
focal_method.parameters: (DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)
focal_method.return: void
focal_method.signature: void writeTo(DataSource dataSource,
                          Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String, Object> httpHeaders,
                          OutputStream entityStream)