public void writeObject(Object o) throws IOException { if (o != null) { this.writeString(o.toString()); } }
@Override public void flush() throws IOException { if (parent != null) parent.flush(); this.w.flush(); }
public static void writeLong(ByteWriter bw, Long i) throws IOException { if (i == Long.MIN_VALUE) { bw.writeString("-9223372036854775808"); return; } int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); char[] buf = bw.getLocalBuffer().getCharBuffer(); getChars(i, size, buf); bw.writeNumberChars(buf, size); }
public Object evaluate(Context ctx) { ByteWriter real = ctx.byteWriter; ByteWriter temp = real.getTempWriter(real); ctx.byteWriter = temp; block.execute(ctx); ctx.byteWriter = real; return temp.getTempConent(); }
ctx.byteWriter.writeString((String) value); return; if (c == Integer.class) ctx.byteWriter.writeInteger((Integer) value); return; ctx.byteWriter.writeLong((Long) value); return; ctx.byteWriter.writeDouble((Double) value); return; ctx.byteWriter.writeFloat((Float) value); return; ctx.byteWriter.writeShort((Short) value); return; ctx.byteWriter.writeString(value.toString());
@Override public void fill(ByteWriter bw) throws IOException { bw.write(bs, count); } }
public static Writer getWriterByByteWriter(ByteWriter byteWriter) { ByteWriter temp = null; while((temp=byteWriter.getParent())!=null){ byteWriter = temp; } Writer w = null; if (byteWriter instanceof ByteWriter_Char) { ByteWriter_Char bw = (ByteWriter_Char) byteWriter; w = bw.getW(); } else { ByteWriter_Byte bw = (ByteWriter_Byte) byteWriter; try { w = new OutputStreamWriter(bw.getOs(), bw.getCs()); } catch (Exception ex) { throw new RuntimeException(ex); } } return w; }
ctx.byteWriter.writeString((String) value); return; if (c == Integer.class) ctx.byteWriter.writeInteger((Integer) value); return; ctx.byteWriter.writeLong((Long) value); return; ctx.byteWriter.writeDouble((Double) value); return; ctx.byteWriter.writeFloat((Float) value); return; ctx.byteWriter.writeShort((Short) value); return; ctx.byteWriter.writeString(value.toString());
protected BodyContent getBodyContent() { ByteWriter writer = ctx.byteWriter; ByteWriter tempWriter = ctx.byteWriter.getTempWriter(writer); ctx.byteWriter = tempWriter; doBodyRender(); ctx.byteWriter = writer; return tempWriter.getTempConent(); }
@Override public void fill(ByteWriter bw) throws IOException { bw.write(this.buf, count); } }
public static Writer getWriterByByteWriter(ByteWriter byteWriter) { ByteWriter temp = null; while((temp=byteWriter.getParent())!=null){ byteWriter = temp; } Writer w = null; if (byteWriter instanceof ByteWriter_Char) { ByteWriter_Char bw = (ByteWriter_Char) byteWriter; w = bw.getW(); } else { ByteWriter_Byte bw = (ByteWriter_Byte) byteWriter; try { w = new OutputStreamWriter(bw.getOs(), bw.getCs()); } catch (Exception ex) { throw new RuntimeException(ex); } } return w; }
public void writeObject(Object o) throws IOException { if (o != null) { this.writeString(o.toString()); } }
public static void writeInteger(ByteWriter bw, Integer i) throws IOException { if (i == Integer.MIN_VALUE) { bw.writeString("-2147483648"); return; } int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); char[] buf = bw.getLocalBuffer().getCharBuffer(); getChars(i, size, buf); bw.writeNumberChars(buf, size); }
public Object evaluate(Context ctx) { ByteWriter real = ctx.byteWriter; ByteWriter temp = real.getTempWriter(real); ctx.byteWriter = temp; block.execute(ctx); ctx.byteWriter = real; return temp.getTempConent(); }
@Override public void fill(ByteWriter bw) throws IOException { bw.write(bs, count); } }
@Override public void flush() throws IOException { if (parent != null) parent.flush(); this.os.flush(); }
/** * Write the escaped body content to the page. * <p>Can be overridden in subclasses, e.g. for testing purposes. * @param content the content to write * @throws IOException if writing failed */ protected void writeBodyContent(String content) throws IOException { Assert.state(this.bodyContent != null, "No BodyContent set"); // this.bodyContent.getEnclosingWriter().print(content); this.ctx.byteWriter.writeString(content); }
public static void writeLong(ByteWriter bw, Long i) throws IOException { if (i == Long.MIN_VALUE) { bw.writeString("-9223372036854775808"); return; } int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); char[] buf = bw.getLocalBuffer().getCharBuffer(); getChars(i, size, buf); bw.writeNumberChars(buf, size); }
protected BodyContent getBodyContent() { ByteWriter writer = ctx.byteWriter; ByteWriter tempWriter = ctx.byteWriter.getTempWriter(writer); ctx.byteWriter = tempWriter; doBodyRender(); ctx.byteWriter = writer; return tempWriter.getTempConent(); }
@Override public void fill(ByteWriter bw) throws IOException { bw.write(this.buf, count); } }