public class DataInputBuffer extends DataInputStream { private static class Buffer extends ByteArrayInputStream {
public Buffer() {
super(new byte[] {});
} public void reset(byte[] input, int start, int length) {
this.buf = input;
this.count = start+length;
this. = start;
this.pos = start;
} public int getPosition() { return pos; }
public int getLength() { return count; }
} private Buffer buffer;
/** Constructs a new empty buffer. */
public DataInputBuffer() {
this(new Buffer());
} private DataInputBuffer(Buffer buffer) {
super(buffer);
this.buffer = buffer;
} /** Resets the data that the buffer reads. */
public void reset(byte[] input, int length) {
buffer.reset(input, 0, length);
} /** Resets the data that the buffer reads. */
public void reset(byte[] input, int start, int length) {
buffer.reset(input, start, length);
} /** Returns the current position in the input. */
public int getPosition() { return buffer.getPosition(); } /** Returns the length of the input. */
public int getLength() { return buffer.getLength(); }}
{
/// <summary>Returns the current position in the input. </summary>
virtual public int Position
{
get
{
return buffer.getPosition();
}
}
/// <summary>Returns the length of the input. </summary>
virtual public int Length
{
get
{
return buffer.getLength();
}
}
private class Buffer:System.IO.MemoryStream
{
public Buffer():base(SupportClass.ToByteArray(new sbyte[]{}))
//public Buffer():base(new sbyte[]{})
{
}
public virtual void reset(sbyte[] input, int start, int length)
{
//UPGRADE_ISSUE: 未转换 字段“java.io.ByteArrayInputStream.buf”。 "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaioByteArrayInputStreambuf_f'"
this.buf = input;
this.Length = (System.Int64) (start + length);
//UPGRADE_ISSUE: 未转换 字段“java.io.ByteArrayInputStream.~”。 "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaioByteArrayInputStream~_f'"
this. = start;
this.Position = (System.Int64) start;
}
public virtual int getPosition()
{
return (int) Position;
}
public virtual int getLength()
{
return (int) Length;
}
}
private Buffer buffer;
/// <summary>Constructs a new empty buffer. </summary>
public DataInputBuffer():this(new Buffer())
{
}
private DataInputBuffer(Buffer buffer):base(buffer)
{
this.buffer = buffer;
}
/// <summary>Resets the data that the buffer reads. </summary>
public virtual void reset(sbyte[] input, int length)
{
buffer.reset(input, 0, length);
}
/// <summary>Resets the data that the buffer reads. </summary>
public virtual void reset(sbyte[] input, int start, int length)
{
buffer.reset(input, start, length);
}
}
你真请我吃饭我就Copy给你~~~哈哈~~~
然后运行一下
然后再打开一个C#的工程点击添加引用
将java中的代码引用过来这样就可以了
两位大哥能否详情说明一下呢? 谢谢了.
我用的是VS2003! 也装了VS2005.我一直是用命令行工具进行转换的, 但效果实在差, 成功率很低....