Example #1
0
 // private Formatter formatter;
 /**
  * Constructs a new {@code PrintStream} with {@code out} as its target
  * stream. By default, the new print stream does not automatically flush its
  * contents to the target stream when a newline is encountered.
  *
  * @param out
  *            the target output stream.
  * @throws NullPointerException
  *             if {@code out} is {@code null}.
  */
 public PrintStream(OutputStream outJ)
     : base(outJ)
 {
     if (outJ == null)
     {
         throw new java.lang.NullPointerException();
     }
 }
 /**
  * Constructs a new {@code BufferedOutputStream} on the {@link OutputStream}
  * {@code out}. The buffer size is set to {@code size}.
  *
  * @param out
  *            the output stream for which write operations are buffered.
  * @param size
  *            the size of the buffer in bytes.
  * @throws IllegalArgumentException
  *             if {@code size <= 0}.
  */
 public BufferedOutputStream(OutputStream outJ, int size)
     : base(outJ)
 {
     if (size <= 0) {
         // luni.A3=size must be > 0
         throw new java.lang.IllegalArgumentException("size must be > 0"); //$NON-NLS-1$
     }
     buf = new byte[size];
 }
 /**
  * Takes the contents of this stream and writes it to the output stream
  * {@code out}.
  *
  * @param out
  *            an OutputStream on which to write the contents of this stream.
  * @throws IOException
  *             if an error occurs while writing to {@code out}.
  */
 public void writeTo(OutputStream outJ)
 {
     //throws IOException {
     outJ.write(buf, 0, count);
 }
Example #4
0
 //throws UnsupportedEncodingException {
 /**
  * Constructs a new {@code PrintStream} with {@code out} as its target
  * stream and using the character encoding {@code enc} while writing. The
  * parameter {@code autoflush} determines if the print stream automatically
  * flushes its contents to the target stream when a newline is encountered.
  *
  * @param out
  *            the target output stream.
  * @param autoflush
  *            indicates whether or not to flush contents upon encountering a
  *            newline sequence.
  * @param enc
  *            the non-null string describing the desired character encoding.
  * @throws NullPointerException
  *             if {@code out} or {@code enc} are {@code null}.
  * @throws UnsupportedEncodingException
  *             if the encoding specified by {@code enc} is not supported.
  */
 public PrintStream(OutputStream outJ, bool autoflush, String enc)
     : base(outJ)
 {
     if (outJ == null || enc == null)
     {
         throw new java.lang.NullPointerException();
     }
     this.autoflush = autoflush;
     try
     {
         if (!java.nio.charset.Charset.isSupported(enc))
         {
             throw new UnsupportedEncodingException(enc);
         }
     }
     catch (java.nio.charset.IllegalCharsetNameException e)
     {
         throw new UnsupportedEncodingException(enc);
     }
     encoding = enc;
 }
Example #5
0
 /**
  * Constructs a new {@code PrintStream} with {@code out} as its target
  * stream. The parameter {@code autoflush} determines if the print stream
  * automatically flushes its contents to the target stream when a newline is
  * encountered.
  *
  * @param out
  *            the target output stream.
  * @param autoflush
  *            indicates whether to flush contents upon encountering a
  *            newline sequence.
  * @throws NullPointerException
  *             if {@code out} is {@code null}.
  */
 public PrintStream(OutputStream outJ, bool autoflush)
     : base(outJ)
 {
     if (outJ == null)
     {
         throw new java.lang.NullPointerException();
     }
     this.autoflush = autoflush;
 }
 public FilterOutputStream(java.io.OutputStream streamToFilter)
 {
     this.outJ = streamToFilter;
 }
Example #7
0
 /**
  * Constructs a new {@code PrintWriter} with {@code out} as its target
  * stream. The parameter {@code autoflush} determines if the print writer
  * automatically flushes its contents to the target stream when a newline is
  * encountered.
  *
  * @param out
  *            the target output stream.
  * @param autoflush
  *            indicates whether contents are flushed upon encountering a
  *            newline sequence.
  * @throws NullPointerException
  *             if {@code out} is {@code null}.
  */
 public PrintWriter(OutputStream outJJ, bool autoflush)
     : this(new OutputStreamWriter(outJJ), autoflush)
 {
 }
Example #8
0
 //AccessController.doPrivileged(new PriviAction<String>("line.separator")); //$NON-NLS-1$
 /**
  * Constructs a new {@code PrintWriter} with {@code out} as its target
  * stream. By default, the new print writer does not automatically flush its
  * contents to the target stream when a newline is encountered.
  *
  * @param out
  *            the target output stream.
  * @throws NullPointerException
  *             if {@code out} is {@code null}.
  */
 public PrintWriter(OutputStream outJJ)
     : this(new OutputStreamWriter(outJJ), false)
 {
 }
Example #9
0
 public OutputStreamWriter(OutputStream outJ, String charsetName)
 {
     cs = java.nio.charset.Charset.forName(charsetName);
     this.delegateInstance = outJ;
 }
Example #10
0
 public OutputStreamWriter(OutputStream outJ)
     : this(outJ, "UTF-8")
 {
 }
Example #11
0
 public ObjectOutputStream(OutputStream oStream)
 {
     DataOutputStream dos = (oStream is DataOutputStream) ? (DataOutputStream)oStream : new DataOutputStream (oStream);
     this.delegateInstance = dos;
 }
Example #12
0
 /**
  * Constructs a new {@code DataOutputStream} on the {@code OutputStream}
  * {@code out}. Note that data written by this stream is not in a human
  * readable form but can be reconstructed by using a {@link DataInputStream}
  * on the resulting output.
  *
  * @param out
  *            the target stream for writing.
  */
 public DataOutputStream(OutputStream outJ)
     : base(outJ)
 {
     buff = new byte[8];
 }
Example #13
0
 /**
  * Constructs a new {@code DataOutputStream} on the {@code OutputStream}
  * {@code out}. Note that data written by this stream is not in a human
  * readable form but can be reconstructed by using a {@link DataInputStream}
  * on the resulting output.
  *
  * @param out
  *            the target stream for writing.
  */
 public DataOutputStream(OutputStream outJ) : base(outJ)
 {
     buff = new byte[8];
 }
 /**
  * Constructs a new {@code BufferedOutputStream} on the {@link OutputStream}
  * {@code out}. The buffer size is set to the default value of 8 KB.
  *
  * @param out
  *            the {@code OutputStream} for which write operations are
  *            buffered.
  */
 public BufferedOutputStream(OutputStream outJ)
     : base(outJ)
 {
     buf = new byte[8192];
 }