Package org.apache.sling.servlethelpers

# Class ByteArrayPart

java.lang.Object
org.apache.sling.servlethelpers.ByteArrayPart

All Implemented Interfaces:
  `jakarta.servlet.http.Part`

public class ByteArrayPart extends Object implements jakarta.servlet.http.Part
Simple Part implementation backed by an in-memory byte array

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`ByteArrayPart.Builder`

## Method Summary

Modifier and Type
Method
Description
`static ByteArrayPart.Builder`
`builder()`
Returns a Builder instance used to create a ByteArrayPart
`void`
`delete()`
`String`
`getContentType()`
`String`
`getHeader(String name)`
`Collection<String>`
`getHeaderNames()`
`Collection<String>`
`getHeaders(String name)`
`InputStream`
`getInputStream()`
`String`
`getName()`
`long`
`getSize()`
`String`
`getSubmittedFileName()`
`void`
`write(String fileName)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### builder

public static ByteArrayPart.Builder builder()
Returns a Builder instance used to create a ByteArrayPart

Returns:
  a new builder instance

### getInputStream

public InputStream getInputStream() throws IOException

Specified by:
  `getInputStream` in interface `jakarta.servlet.http.Part`
Throws:
  `IOException`

### getContentType

public String getContentType()

Specified by:
  `getContentType` in interface `jakarta.servlet.http.Part`

### getName

public String getName()

Specified by:
  `getName` in interface `jakarta.servlet.http.Part`

### getSubmittedFileName

public String getSubmittedFileName()

Specified by:
  `getSubmittedFileName` in interface `jakarta.servlet.http.Part`

### getSize

public long getSize()

Specified by:
  `getSize` in interface `jakarta.servlet.http.Part`

### write

public void write(String fileName) throws IOException

Specified by:
  `write` in interface `jakarta.servlet.http.Part`
Throws:
  `IOException`

### delete

public void delete() throws IOException

Specified by:
  `delete` in interface `jakarta.servlet.http.Part`
Throws:
  `IOException`

### getHeader

public String getHeader(String name)

Specified by:
  `getHeader` in interface `jakarta.servlet.http.Part`

### getHeaders

public Collection<String> getHeaders(String name)

Specified by:
  `getHeaders` in interface `jakarta.servlet.http.Part`

### getHeaderNames

public Collection<String> getHeaderNames()

Specified by:
  `getHeaderNames` in interface `jakarta.servlet.http.Part`