Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2012 the project-owners Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package inti.util;
A simple pass-through output stream with reset method.
public abstract class AbstractOutputStream extends OutputStream {
    
    
The underlying stream.
    protected OutputStream stream;
    
byte-array for writing single bytes - not thread-safe.
    protected byte[] singleByte = new byte[1];
    
    
Sets the underlying stream.

Parameters:
stream
    public void reset(OutputStream stream) {
        this. = stream;
    }
    
    
Closes the underlying stream.
    @Override
    public void close() throws IOException {
        .close();
    }
    
    
Flushes the underlying stream.
    @Override
    public void flush() throws IOException {
        .flush();
    }
    
    
Uses the singleByte-array and pass it to the java.io.OutputStream.write(byte[],int,int) method.
    @Override
    public void write(int bthrows IOException {
        [0] = (byteb;
        write(, 0, .);
    }
    
New to GrepCode? Check out our FAQ X