Note
This instantiator may not work properly if the class being instantiated defines a "readResolve" method, since it may return objects that have been returned previously (i.e., there's no guarantee that the returned object is a new one), or even objects from a completely different class.
org.springframework.objenesis.instantiator.ObjectInstantiator
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectInputStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public T | newInstance()
Implements org. Returns a new instance of an object. |
| inputStream | back to summary |
|---|---|
| private final ObjectInputStream inputStream | |
| ObjectInputStreamInstantiator | back to summary |
|---|---|
| public ObjectInputStreamInstantiator(Class<T> clazz) | |
| newInstance | back to summary |
|---|---|
| public T newInstance() Implements org. Doc from org. Returns a new instance of an object. The returned object's class is defined by the implementation.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[][] | |
| private byte[] | |
| private static byte[] | |
| private static final int[] | |
| private int | |
| private static byte[] | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | available()
Overrides java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected. |
| private static void | |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| buffers | back to summary |
|---|---|
| private final byte[][] buffers | |
| data | back to summary |
|---|---|
| private byte[] data | |
| HEADER | back to summary |
|---|---|
| private static byte[] HEADER | |
| NEXT | back to summary |
|---|---|
| private static final int[] NEXT | |
| pointer | back to summary |
|---|---|
| private int pointer | |
| REPEATING_DATA | back to summary |
|---|---|
| private static byte[] REPEATING_DATA | |
| sequence | back to summary |
|---|---|
| private int sequence | |
| MockStream | back to summary |
|---|---|
| public MockStream(Class<?> clazz) | |
| advanceBuffer | back to summary |
|---|---|
| private void advanceBuffer() | |
| available | back to summary |
|---|---|
| public int available() Overrides java. Doc from java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected. The read might be on the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes. Note that while some implementations of A subclass's implementation of this method may choose to throw an
| |
| initialize | back to summary |
|---|---|
| private static void initialize() | |
| read | back to summary |
|---|---|
| public int read() Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |