public class

Base64InputStreamConsumer

extends Object
implements Consumer<T>
java.lang.Object
   ↳ com.atlassian.jira.util.Base64InputStreamConsumer

Class Overview

Basic slurp implementation of an InputStream Consumer which provides Base64 encoded output. Note that this reads the whole input into memory and should not be used for data that may grow big.

Summary

Public Constructors
Base64InputStreamConsumer(boolean chunked)
Creates this encoder.
Public Methods
void consume(InputStream element)
String getEncoded()
Gives the Base64 encoded String only if the consume method ran without exception.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.Consumer

Public Constructors

public Base64InputStreamConsumer (boolean chunked)

Creates this encoder. Set chunked to true if you want a 72 character formatted ("chunked") String or false if you don't need formatting.

Parameters
chunked whether you want a chunked Base64 encoded output.

Public Methods

public void consume (InputStream element)

public String getEncoded ()

Gives the Base64 encoded String only if the consume method ran without exception. Otherwise returns the empty String.

Returns
  • the empty String or the base64 encoded content of the InputStream.