cos.write(i); array[i-20] = (byte)i; cos.write(array); assertByteArrayEquals("CountingOutputStream.write(byte[])", baos.toByteArray(), 0, 30); assertEquals("CountingOutputStream.getCount()", cos.getCount(), 30); array[i-25] = (byte)i; cos.write(array, 5, 5); assertByteArrayEquals("CountingOutputStream.write(byte[], int, int)", baos.toByteArray(), 0, 35); assertEquals("CountingOutputStream.getCount()", cos.getCount(), 35); cos.write(i);
int sz; while ((sz = f.read(buf)) >= 0) os.write(buf, 0, sz); } else { ByteBuf buf = new ByteBuf(null, f);
/** * Sends the form feed character. * @throws IOException In case of an I/O error */ public void formFeed() throws IOException { out.write(12); //=OC ("FF", Form feed) }
public void write(byte[] b, int off, int len) throws IOException { os.write(b, off, len); }
public void write(byte[] b) throws IOException { os.write(b); }
/** * Writes raw bytes to the output stream * @param bytes The bytes * @throws IOException In case of an I/O error */ public void writeBytes(byte[] bytes) throws IOException { out.write(bytes); }
public void write(int b) throws IOException { os.write(b); }
/** * Writes raw text (in ISO-8859-1 encoding) to the output stream. * @param s the text * @throws IOException In case of an I/O error */ public void writeText(String s) throws IOException { out.write(s.getBytes(ISO_8859_1)); }
@Override public void write(byte[] bts) throws IOException { if (getByteCount() > maxSize) { return; } super.write(bts); }
@Override public void write(int idx) throws IOException { if (getByteCount() > maxSize) { return; } super.write(idx); }
@Override public void write(byte[] bts, int st, int end) throws IOException { if (getByteCount() > maxSize) { return; } super.write(bts, st, end); }
CountingOutputStream cos = new CountingOutputStream(socket.getOutputStream()); cos.write(...); System.out.println("wrote " + cos.getByteCount() + " bytes");
public void endLine() throws IOException { if (zeroRow && PCLGenerator.this.currentSourceTransparency) { writeCommand("*b1Y"); } else if (rlewidth < bytewidth) { writeCommand("*b1m" + rlewidth + "W"); out.write(rle, 0, rlewidth); } else { writeCommand("*b0m" + bytewidth + "W"); out.write(uncompressed); } lastcount = -1; rlewidth = 0; ib = 0; x = 0; zeroRow = true; }
int i = -1; while ((i = in.read(b)) != -1) { cout.write(b, 0, i);
int i = -1; while ((i = in.read(b)) != -1) { cout.write(b, 0, i);
int sz; while((sz=f.read(buf))>=0) os.write(buf,0,sz); } else { ByteBuf buf = new ByteBuf(null,f);
int sz; while((sz=f.read(buf))>=0) os.write(buf,0,sz); } else { ByteBuf buf = new ByteBuf(null,f);
int sz; while((sz=f.read(buf))>=0) os.write(buf,0,sz); } else { ByteBuf buf = new ByteBuf(null,f);