to top
public class

FixedByteArrayOutputStream

extends OutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ com.android.tradefed.util.FixedByteArrayOutputStream

Class Overview

An in-memory OutputStream that only keeps a maximum amount of data.

This is implemented by keeping a circular byte array of fixed size.

Not thread safe.

Summary

Public Constructors
FixedByteArrayOutputStream(int maxDataSize)
Public Methods
InputStream getData()
Gets a InputStream for reading collected output.
long size()
void write(int data)
[Expand]
Inherited Methods
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable
From interface java.lang.AutoCloseable

Public Constructors

public FixedByteArrayOutputStream (int maxDataSize)

Parameters
maxDataSize the approximate max size in bytes to keep in the output stream

Public Methods

public InputStream getData ()

Gets a InputStream for reading collected output.

Not thread safe. Assumes no data will be written while being read

public long size ()

Returns
  • the number of bytes currently stored.

public void write (int data)

Throws
IOException