124 |
|
|
125 |
ch = FileChannelImpl.create(file, fdmode); |
ch = FileChannelImpl.create(file, fdmode); |
126 |
fd = new FileDescriptor(ch); |
fd = new FileDescriptor(ch); |
127 |
out = new DataOutputStream (new FileOutputStream (fd)); |
if ((fdmode & FileChannelImpl.WRITE) != 0) |
128 |
|
out = new DataOutputStream (new FileOutputStream (fd)); |
129 |
|
else |
130 |
|
out = null; |
131 |
in = new DataInputStream (new FileInputStream (fd)); |
in = new DataInputStream (new FileInputStream (fd)); |
132 |
} |
} |
133 |
|
|
769 |
*/ |
*/ |
770 |
public void write (int oneByte) throws IOException |
public void write (int oneByte) throws IOException |
771 |
{ |
{ |
772 |
|
if (out == null) |
773 |
|
throw new IOException("Bad file descriptor"); |
774 |
|
|
775 |
out.write(oneByte); |
out.write(oneByte); |
776 |
} |
} |
777 |
|
|
783 |
*/ |
*/ |
784 |
public void write (byte[] buffer) throws IOException |
public void write (byte[] buffer) throws IOException |
785 |
{ |
{ |
786 |
|
if (out == null) |
787 |
|
throw new IOException("Bad file descriptor"); |
788 |
|
|
789 |
out.write(buffer); |
out.write(buffer); |
790 |
} |
} |
791 |
|
|
801 |
*/ |
*/ |
802 |
public void write (byte[] buffer, int offset, int len) throws IOException |
public void write (byte[] buffer, int offset, int len) throws IOException |
803 |
{ |
{ |
804 |
|
if (out == null) |
805 |
|
throw new IOException("Bad file descriptor"); |
806 |
|
|
807 |
out.write (buffer, offset, len); |
out.write (buffer, offset, len); |
808 |
} |
} |
809 |
|
|
818 |
*/ |
*/ |
819 |
public final void writeBoolean (boolean val) throws IOException |
public final void writeBoolean (boolean val) throws IOException |
820 |
{ |
{ |
821 |
|
if (out == null) |
822 |
|
throw new IOException("Bad file descriptor"); |
823 |
|
|
824 |
out.writeBoolean(val); |
out.writeBoolean(val); |
825 |
} |
} |
826 |
|
|
835 |
*/ |
*/ |
836 |
public final void writeByte (int val) throws IOException |
public final void writeByte (int val) throws IOException |
837 |
{ |
{ |
838 |
|
if (out == null) |
839 |
|
throw new IOException("Bad file descriptor"); |
840 |
|
|
841 |
out.writeByte(val); |
out.writeByte(val); |
842 |
} |
} |
843 |
|
|
852 |
*/ |
*/ |
853 |
public final void writeShort (int val) throws IOException |
public final void writeShort (int val) throws IOException |
854 |
{ |
{ |
855 |
|
if (out == null) |
856 |
|
throw new IOException("Bad file descriptor"); |
857 |
|
|
858 |
out.writeShort(val); |
out.writeShort(val); |
859 |
} |
} |
860 |
|
|
869 |
*/ |
*/ |
870 |
public final void writeChar (int val) throws IOException |
public final void writeChar (int val) throws IOException |
871 |
{ |
{ |
872 |
|
if (out == null) |
873 |
|
throw new IOException("Bad file descriptor"); |
874 |
|
|
875 |
out.writeChar(val); |
out.writeChar(val); |
876 |
} |
} |
877 |
|
|
885 |
*/ |
*/ |
886 |
public final void writeInt (int val) throws IOException |
public final void writeInt (int val) throws IOException |
887 |
{ |
{ |
888 |
|
if (out == null) |
889 |
|
throw new IOException("Bad file descriptor"); |
890 |
|
|
891 |
out.writeInt(val); |
out.writeInt(val); |
892 |
} |
} |
893 |
|
|
901 |
*/ |
*/ |
902 |
public final void writeLong (long val) throws IOException |
public final void writeLong (long val) throws IOException |
903 |
{ |
{ |
904 |
|
if (out == null) |
905 |
|
throw new IOException("Bad file descriptor"); |
906 |
|
|
907 |
out.writeLong(val); |
out.writeLong(val); |
908 |
} |
} |
909 |
|
|
923 |
*/ |
*/ |
924 |
public final void writeFloat (float val) throws IOException |
public final void writeFloat (float val) throws IOException |
925 |
{ |
{ |
926 |
|
if (out == null) |
927 |
|
throw new IOException("Bad file descriptor"); |
928 |
|
|
929 |
out.writeFloat(val); |
out.writeFloat(val); |
930 |
} |
} |
931 |
|
|
946 |
*/ |
*/ |
947 |
public final void writeDouble (double val) throws IOException |
public final void writeDouble (double val) throws IOException |
948 |
{ |
{ |
949 |
|
if (out == null) |
950 |
|
throw new IOException("Bad file descriptor"); |
951 |
|
|
952 |
out.writeDouble(val); |
out.writeDouble(val); |
953 |
} |
} |
954 |
|
|
963 |
*/ |
*/ |
964 |
public final void writeBytes (String val) throws IOException |
public final void writeBytes (String val) throws IOException |
965 |
{ |
{ |
966 |
|
if (out == null) |
967 |
|
throw new IOException("Bad file descriptor"); |
968 |
|
|
969 |
out.writeBytes(val); |
out.writeBytes(val); |
970 |
} |
} |
971 |
|
|
980 |
*/ |
*/ |
981 |
public final void writeChars (String val) throws IOException |
public final void writeChars (String val) throws IOException |
982 |
{ |
{ |
983 |
|
if (out == null) |
984 |
|
throw new IOException("Bad file descriptor"); |
985 |
|
|
986 |
out.writeChars(val); |
out.writeChars(val); |
987 |
} |
} |
988 |
|
|
1017 |
*/ |
*/ |
1018 |
public final void writeUTF (String val) throws IOException |
public final void writeUTF (String val) throws IOException |
1019 |
{ |
{ |
1020 |
|
if (out == null) |
1021 |
|
throw new IOException("Bad file descriptor"); |
1022 |
|
|
1023 |
out.writeUTF(val); |
out.writeUTF(val); |
1024 |
} |
} |
1025 |
|
|