java.io.ObjectOutputStream
immediately after calling it's
java.io.ObjectOutputStream#writeObject(Object) method.
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectOutputStream | |
| private final int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | AutoFlushingObjectWriter(ObjectOutputStream
the stream to write to objectOutputStream, int the frequency with which the given stream will be
automatically reset to prevent a memory leak resetFrequency)Creates a new instance for the given |
| Modifier and Type | Method and Description |
|---|---|
| private void | preventMemoryLeak()
Failing to reset the object output stream every now and then creates a
serious memory leak which is why the underlying stream will be reset
according to the |
| public void | write(Object
the object)Object to writeImplements ch. |
| objectOutputStream | back to summary |
|---|---|
| private final ObjectOutputStream objectOutputStream | |
| resetFrequency | back to summary |
|---|---|
| private final int resetFrequency | |
| writeCounter | back to summary |
|---|---|
| private int writeCounter | |
| AutoFlushingObjectWriter | back to summary |
|---|---|
| public AutoFlushingObjectWriter(ObjectOutputStream objectOutputStream, int resetFrequency) Creates a new instance for the given
| |
| preventMemoryLeak | back to summary |
|---|---|
| private void preventMemoryLeak() throws IOException Failing to reset the object output stream every now and then creates a
serious memory leak which is why the underlying stream will be reset
according to the | |
| write | back to summary |
|---|---|
| public void write(Object object) throws IOException Implements ch. Doc from ch. Writes an object to an output.
| |