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(); }}

解决方案 »

  1.   

    我用机器转换的结果如下, 但是好多错误, 晕, 哪位高人帮我看一下... public class DataInputBuffer:System.IO.BinaryReader
    {
    /// <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);
    }
    }