org.dmonix.io
Class Unix2DosOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byorg.dmonix.io.Unix2DosOutputStream

public class Unix2DosOutputStream
extends java.io.FilterOutputStream

A filter outputstream that converts Unix formatted line breaks (#10 , \n) to Windows formatted line breaks, i.e. adding carriage return (#13#10 , \r\n) signs.

Copyright: Copyright (c) 2005

Company: dmonix.org

Version:
1.0
Author:
Peter Nerg

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
Unix2DosOutputStream(java.io.OutputStream out)
           
 
Method Summary
 void write(byte[] b)
          Writes an array of bytes.
 void write(byte[] b, int off, int len)
          Writes an array of bytes.
 void write(int b)
          Writes a single byte value.
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unix2DosOutputStream

public Unix2DosOutputStream(java.io.OutputStream out)
Method Detail

write

public void write(byte[] b)
           throws java.io.IOException
Writes an array of bytes.
Invoking this method equals
write(b, 0, b.length);

Parameters:
b - The data
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Writes a single byte value.
If the data equals #10 (line feed), the method adds (if not already present) a #13 (carriage return) before the #10.

Parameters:
b - The data
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes an array of bytes.
The method will invoke write(int b) for each byte in the array that is to be written.

Parameters:
b - The data
off - The position to start in the array
len - The amount of data to use from the array
Throws:
java.io.IOException


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.