public int read(byte[] b) {
return in.read(b);
}
+
+ public void close() {
+ in.close();
+ }
}
nativeWrite(fd, b, 0, b.length);
}
+ public void write(byte[] b, int index, int len) {
+ nativeWrite(fd, b, index, len);
+ }
+
public void flush() {
nativeFlush(fd);
}
public class InputStream {
public int read() {
+ System.printString("called unimplemented read\n");
}
public int read(byte[] b) {
+ System.printString("called unimplemented read(byte[]b)\n");
}
public void close() {
+ System.printString("Called unimplemented close()\n");
}
}
public native int getType();
public String toString() {
- return String.valueOf(this);
+ return "Object"+hashCode();
}
public boolean equals(Object o) {
public native int MonitorExit();
public String toString() {
- return String.valueOf(this);
+ return "Object"+hashCode();
}
public boolean equals(Object o) {
public native int getType();
public String toString() {
- return String.valueOf(this);
+ return "Object"+hashCode();
}
public boolean equals(Object o) {
public native int getType();
public String toString() {
- return String.valueOf(this);
+ return "Object"+hashCode();
}
public boolean equals(Object o) {
}
public void write(int ch) {
+ System.printString("Called unimplemented write(int)\n");
}
public void write(byte[] b) {
+ System.printString("Called unimplemented write(byte[])\n");
}
public void write(byte[] b, int off, int len) {
+ System.printString("Called unimplemented write(byte[],int,int)\n");
}
public void flush() {
}
public void close() {
+ System.printString("Called unimplemented close()\n");
}
}
this.fos=fos;
}
-
-
+ public void write(String s) {
+ fos.write(s.getBytes());
+ }
+ public void flush() {
+ fos.flush();
+ }
}
public Socket() {
sin=new SocketInputStream(this);
-
+ sout=new SocketOutputStream(this);
}
public InputStream getInputStream() {
return sin;
}
+ public OutputSream getOutputStream() {
+ return sout;
+ }
+
public Socket(String host, int port) {
InetAddress address=InetAddress.getByName(host);
fd=nativeBind(address.getAddress(), port);
return nativeRead(b);
}
public void write(byte[] b) {
- nativeWrite(b);
+ nativeWrite(b, 0, b.length);
+ }
+
+ public void write(byte[] b, int offset, int leng) {
+ nativeWrite(b, offset, len);
}
private native int nativeRead(byte[] b);
- private native void nativeWrite(byte[] b);
+ private native void nativeWrite(byte[] b, int offset, int len);
private native void nativeClose();
public void close() {
int len=s.read(x);
if (len==0)
return -1;
- else return x[1];
+ else return x[0];
+ }
+
+ public int read(byte[] b) {
+ return s.read(b);
+ }
+
+ public void close() {
+ s.close();
}
}
InetAddress address=InetAddress.getByName(host);
fd=nativeBind(address.getAddress(), port);
nativeConnect(fd, address.getAddress(), port);
+ sin=new SocketInputStream(this);
+ sout=new SocketOutputStream(this);
}
public Socket(InetAddress address, int port) {
fd=nativeBind(address.getAddress(), port);
nativeConnect(fd, address.getAddress(), port);
+ sin=new SocketInputStream(this);
+ sout=new SocketOutputStream(this);
}
public static native int nativeBind(byte[] address, int port);
return nativeRead(b);
}
public void write(byte[] b) {
- nativeWrite(b);
+ nativeWrite(b, 0, b.length);
+ }
+
+ public void write(byte[] b, int offset, int len) {
+ nativeWrite(b, offset, len);
}
private native int nativeRead(byte[] b);
- private native void nativeWrite(byte[] b);
+ private native void nativeWrite(byte[] b, int offset, int len);
private native void nativeClose();
public void close() {
this.s=s;
}
+ public void write(byte[]b) {
+ s.write(b);
+ }
+
+ public void write(int ch) {
+ byte[] b=new byte[1];
+ b[0]=(byte)ch;
+ s.write(b);
+ }
+ public void write(byte[] b, int offset, int len) {
+ s.write(b, offset, len);
+ }
+
+ public void close() {
+ s.close();
+ }
}
String str=new String();
if (beginIndex>this.count||endIndex>this.count||beginIndex>endIndex) {
// FIXME
+ System.printString("Index error: "+this+" "+beginIndex+" "+endIndex+"\n");
}
str.value=this.value;
str.count=endIndex-beginIndex;
if (k>fromIndex)
k=fromIndex;
for(;k>=0;k--) {
- if (regionMatches(fromIndex, str, 0, str.count))
+ if (regionMatches(k, str, 0, str.count))
return k;
}
return -1;
public class Writer {
public void write(String s) {
+ System.printString("Unimplemented write(String) in Writer\n");
}
public void write(String s, int off, int len) {
}
public void flush() {
- }
+ System.printString("Unimplemented flush in Writer\n");
+ }
public void close() {
+ System.printString("Unimplemented close in Writer\n");
}
}
return newfd;
}
-void CALL02(___Socket______nativeWrite_____AR_B, struct ___Socket___ * ___this___, struct ArrayObject * ___b___) {
+void CALL24(___Socket______nativeWrite_____AR_B_I_I, int offset, int length, struct ___Socket___ * ___this___, struct ArrayObject * ___b___, int offset, int length) {
int fd=VAR(___this___)->___fd___;
- int length=VAR(___b___)->___length___;
- char * charstr=((char *)& VAR(___b___)->___length___)+sizeof(int);
+ char * charstr=((char *)& VAR(___b___)->___length___)+sizeof(int)+offset;
while(1) {
int bytewritten=write(fd, charstr, length);
if (bytewritten==-1&&errno==EAGAIN)