com.hammingweight.hammock.mocks.io
Class MockByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by com.hammingweight.hammock.mocks.io.MockByteArrayOutputStream
All Implemented Interfaces:
IMockObject

public class MockByteArrayOutputStream
extends java.io.ByteArrayOutputStream
implements IMockObject


Field Summary
static MockMethod MTHD_CLOSE
           
static MockMethod MTHD_FLUSH
           
static MockMethod MTHD_RESET
           
static MockMethod MTHD_SIZE
           
static MockMethod MTHD_TO_BYTE_ARRAY
           
static MockMethod MTHD_WRITE_$_ARRAY_BYTE
           
static MockMethod MTHD_WRITE_$_ARRAY_BYTE_INT_INT
           
static MockMethod MTHD_WRITE_$_INT
           
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
MockByteArrayOutputStream()
           
MockByteArrayOutputStream(IInvocationHandler handler)
           
MockByteArrayOutputStream(int arg0)
           
MockByteArrayOutputStream(int arg0, IInvocationHandler handler)
           
 
Method Summary
 void close()
           
 void flush()
           
 IInvocationHandler getInvocationHandler()
          Gets the invocation handler that the mock object uses to evaluate method invocations.
 void reset()
           
 void setInvocationHandler(IInvocationHandler handler)
          Sets the invocation handler that the mock object should use to evaluate method invocations.
 int size()
           
 byte[] toByteArray()
           
 void write(byte[] arg0)
           
 void write(byte[] arg0, int arg1, int arg2)
           
 void write(int arg0)
           
 
Methods inherited from class java.io.ByteArrayOutputStream
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MTHD_CLOSE

public static final MockMethod MTHD_CLOSE

MTHD_FLUSH

public static final MockMethod MTHD_FLUSH

MTHD_RESET

public static final MockMethod MTHD_RESET

MTHD_SIZE

public static final MockMethod MTHD_SIZE

MTHD_TO_BYTE_ARRAY

public static final MockMethod MTHD_TO_BYTE_ARRAY

MTHD_WRITE_$_ARRAY_BYTE

public static final MockMethod MTHD_WRITE_$_ARRAY_BYTE

MTHD_WRITE_$_ARRAY_BYTE_INT_INT

public static final MockMethod MTHD_WRITE_$_ARRAY_BYTE_INT_INT

MTHD_WRITE_$_INT

public static final MockMethod MTHD_WRITE_$_INT
Constructor Detail

MockByteArrayOutputStream

public MockByteArrayOutputStream(int arg0)

MockByteArrayOutputStream

public MockByteArrayOutputStream(int arg0,
                                 IInvocationHandler handler)

MockByteArrayOutputStream

public MockByteArrayOutputStream()

MockByteArrayOutputStream

public MockByteArrayOutputStream(IInvocationHandler handler)
Method Detail

setInvocationHandler

public final void setInvocationHandler(IInvocationHandler handler)
Description copied from interface: IMockObject
Sets the invocation handler that the mock object should use to evaluate method invocations.

Specified by:
setInvocationHandler in interface IMockObject
Parameters:
handler - The invocation handler to be used by the mock object.

getInvocationHandler

public final IInvocationHandler getInvocationHandler()
Description copied from interface: IMockObject
Gets the invocation handler that the mock object uses to evaluate method invocations.

Specified by:
getInvocationHandler in interface IMockObject
Returns:
The invocation handler used by the mock object.

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.ByteArrayOutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

reset

public void reset()
Overrides:
reset in class java.io.ByteArrayOutputStream

size

public int size()
Overrides:
size in class java.io.ByteArrayOutputStream

toByteArray

public byte[] toByteArray()
Overrides:
toByteArray in class java.io.ByteArrayOutputStream

write

public void write(byte[] arg0)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] arg0,
                  int arg1,
                  int arg2)
Overrides:
write in class java.io.ByteArrayOutputStream

write

public void write(int arg0)
Overrides:
write in class java.io.ByteArrayOutputStream