@Override
  public long getLength() {
    if (length == null) {
      length = objectMetadata().getSize();
    }
    return length;
  }
@Test
  public void testGetLength() {
    OSSURI uri = randomURI();

    int dataSize = 8;
    byte[] data = randomData(dataSize);
    writeOSSData(uri, data);

    verifyLength(ossMock, uri, data, true);
    verify(ossMock, times(0)).getSimplifiedObjectMeta(uri.bucket(), uri.key());
    reset(ossMock);

    verifyLength(ossMock, uri, data, false);
    verify(ossMock, times(1)).getSimplifiedObjectMeta(uri.bucket(), uri.key());
    reset(ossMock);
  }