Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ObjectLoader.openStream()


    assertEquals(type, ol.getType());
    assertEquals(data.length, ol.getSize());
    assertFalse("is not large", ol.isLarge());
    assertTrue("same content", Arrays.equals(data, ol.getCachedBytes()));

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(type, in.getType());
    assertEquals(data.length, in.getSize());
    byte[] data2 = new byte[data.length];
    IO.readFully(in, data2, 0, data.length);
View Full Code Here


      fail("Should have thrown LargeObjectException");
    } catch (LargeObjectException tooBig) {
      assertEquals(id.name(), tooBig.getMessage());
    }

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(type, in.getType());
    assertEquals(data.length, in.getSize());
    byte[] data2 = new byte[data.length];
    IO.readFully(in, data2, 0, data.length);
View Full Code Here

          e = new LargeObjectException(id.toObjectId());
          e.initCause(noMemory);
          throw e;
        }
        InputStream in = ldr.openStream();
        try {
          IO.readFully(in, buf, 0, buf.length);
        } finally {
          in.close();
        }
View Full Code Here

    assertEquals(data3.length, ol.getSize());
    assertFalse("is large", ol.isLarge());
    assertNotNull(ol.getCachedBytes());
    assertTrue(Arrays.equals(data3, ol.getCachedBytes()));

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(Constants.OBJ_BLOB, in.getType());
    assertEquals(data3.length, in.getSize());
    byte[] act = new byte[data3.length];
    IO.readFully(in, act, 0, data3.length);
View Full Code Here

      fail("Should have thrown LargeObjectException");
    } catch (LargeObjectException tooBig) {
      assertEquals(id3.name(), tooBig.getMessage());
    }

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(Constants.OBJ_BLOB, in.getType());
    assertEquals(data3.length, in.getSize());
    byte[] act = new byte[data3.length];
    IO.readFully(in, act, 0, data3.length);
View Full Code Here

      fail("Should have thrown LargeObjectException");
    } catch (LargeObjectException tooBig) {
      assertEquals(id3.name(), tooBig.getMessage());
    }

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(Constants.OBJ_BLOB, in.getType());
    assertEquals(data3.length, in.getSize());
    byte[] act = new byte[data3.length];
    IO.readFully(in, act, 0, data3.length);
View Full Code Here

    assertEquals(type, ol.getType());
    assertEquals(data.length, ol.getSize());
    assertFalse("is not large", ol.isLarge());
    assertTrue("same content", Arrays.equals(data, ol.getCachedBytes()));

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(type, in.getType());
    assertEquals(data.length, in.getSize());
    byte[] data2 = new byte[data.length];
    IO.readFully(in, data2, 0, data.length);
View Full Code Here

      fail("Should have thrown LargeObjectException");
    } catch (LargeObjectException tooBig) {
      assertEquals(id.name(), tooBig.getMessage());
    }

    ObjectStream in = ol.openStream();
    assertNotNull("have stream", in);
    assertEquals(type, in.getType());
    assertEquals(data.length, in.getSize());
    byte[] data2 = new byte[data.length];
    IO.readFully(in, data2, 0, data.length);
View Full Code Here

      }
    }

    try {
      byte[] tmp = new byte[data.length];
      InputStream in = ol.openStream();
      try {
        IO.readFully(in, tmp, 0, tmp.length);
      } finally {
        in.close();
      }
View Full Code Here

        fs.close();
      }
    }

    byte[] tmp = new byte[data.length];
    InputStream in = ol.openStream();
    IO.readFully(in, tmp, 0, tmp.length);
    try {
      in.close();
      fail("close did not throw CorruptObjectException");
    } catch (CorruptObjectException coe) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.