X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fio%2FUnReaderStream.java;fp=src%2Forg%2Fibex%2Fio%2FUnReaderStream.java;h=ae1777e0b5eb05ac4914579d58451dff2b7d4b07;hb=3e1c83f8d1d65b96a3e24c3aa2a042c21f005111;hp=0000000000000000000000000000000000000000;hpb=146c5fbaa3c5b80ad4da96fed82ea701fac92c6c;p=org.ibex.io.git diff --git a/src/org/ibex/io/UnReaderStream.java b/src/org/ibex/io/UnReaderStream.java new file mode 100644 index 0000000..ae1777e --- /dev/null +++ b/src/org/ibex/io/UnReaderStream.java @@ -0,0 +1,23 @@ +// Copyright 2000-2007 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + +package org.ibex.io; + +import java.io.*; + +/** package-private helper */ +class UnReaderStream extends OutputStream { + + private final ByteBufInputStream bbis; + public UnReaderStream(ByteBufInputStream bbis) { + this.bbis = bbis; + } + + public void close() { } + public void write(int i) throws IOException { byte[] b = new byte[1]; b[0] = (byte)i; write(b, 0, 1); } + public void write(byte[] b) throws IOException { write(b, 0, b.length); } + public void write(byte[] b, int p, int l) { + bbis.pushback(b, p, l); + } +}