@Test public void release() { ByteArrayFineIoWriter.build(location, true).release(); verify(byteWriter).release(); verify(intWriter).release(); verify(longWriter).release(); ByteArrayFineIoWriter.build(location, false).release(); verify(byteWriter, times(2)).release(); verify(intWriter, times(2)).release(); verify(longWriter, times(3)).release(); }
public static ByteArrayWriter build(URI location, boolean isOverwrite) { URI contentLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.CONTENT); ByteWriter contentWriter = ByteFineIoWriter.build(contentLocation, isOverwrite); URI positionLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.POSITION); LongWriter positionWriter = LongFineIoWriter.build(positionLocation, isOverwrite); URI lengthLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LENGTH); IntWriter lengthWriter = IntFineIoWriter.build(lengthLocation, isOverwrite); URI lastPosLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LAST_POSITION); LongWriter lastPosWriter = isOverwrite ? null : LongFineIoWriter.build(lastPosLocation, true); LongReader lastPosReader = isOverwrite ? null : LongFineIoReader.build(lastPosLocation); return new BaseByteArrayWriter(contentWriter, positionWriter, lengthWriter, isOverwrite, lastPosWriter, lastPosReader); }
ByteArrayFineIoWriter { public static ByteArrayWriter build(URI location, boolean isOverwrite) { URI contentLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.CONTENT); ByteWriter contentWriter = ByteFineIoWriter.build(contentLocation, isOverwrite); URI positionLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.POSITION); LongWriter positionWriter = LongFineIoWriter.build(positionLocation, isOverwrite); URI lengthLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LENGTH); IntWriter lengthWriter = IntFineIoWriter.build(lengthLocation, isOverwrite); URI lastPosLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LAST_POSITION); LongWriter lastPosWriter = isOverwrite ? null : LongFineIoWriter.build(lastPosLocation, true); LongReader lastPosReader = isOverwrite ? null : LongFineIoReader.build(lastPosLocation); return new BaseByteArrayWriter(contentWriter, positionWriter, lengthWriter, isOverwrite, lastPosWriter, lastPosReader); } }
ByteArrayFineIoWriter { public static ByteArrayWriter build(URI location, boolean isOverwrite) { URI contentLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.CONTENT); ByteWriter contentWriter = ByteFineIoWriter.build(contentLocation, isOverwrite); URI positionLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.POSITION); LongWriter positionWriter = LongFineIoWriter.build(positionLocation, isOverwrite); URI lengthLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LENGTH); IntWriter lengthWriter = IntFineIoWriter.build(lengthLocation, isOverwrite); URI lastPosLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LAST_POSITION); LongWriter lastPosWriter = isOverwrite ? null : LongFineIoWriter.build(lastPosLocation, true); LongReader lastPosReader = isOverwrite ? null : LongFineIoReader.build(lastPosLocation); return new BaseByteArrayWriter(contentWriter, positionWriter, lengthWriter, isOverwrite, lastPosWriter, lastPosReader); }  }
ByteArrayFineIoWriter { public static ByteArrayWriter build(URI location, boolean isOverwrite) { URI contentLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.CONTENT); ByteWriter contentWriter = ByteFineIoWriter.build(contentLocation, isOverwrite); URI positionLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.POSITION); LongWriter positionWriter = LongFineIoWriter.build(positionLocation, isOverwrite); URI lengthLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LENGTH); IntWriter lengthWriter = IntFineIoWriter.build(lengthLocation, isOverwrite); URI lastPosLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LAST_POSITION); LongWriter lastPosWriter = isOverwrite ? null : LongFineIoWriter.build(lastPosLocation, true); LongReader lastPosReader = isOverwrite ? null : LongFineIoReader.build(lastPosLocation); return new BaseByteArrayWriter(contentWriter, positionWriter, lengthWriter, isOverwrite, lastPosWriter, lastPosReader); }  static ByteArrayWriter build(URI location, boolean isOverwrite); }
ByteArrayFineIoWriter { public static ByteArrayWriter build(URI location, boolean isOverwrite) { URI contentLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.CONTENT); ByteWriter contentWriter = ByteFineIoWriter.build(contentLocation, isOverwrite); URI positionLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.POSITION); LongWriter positionWriter = LongFineIoWriter.build(positionLocation, isOverwrite); URI lengthLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LENGTH); IntWriter lengthWriter = IntFineIoWriter.build(lengthLocation, isOverwrite); URI lastPosLocation = URI.create(location.getPath() + "/" + ByteArrayWriter.LAST_POSITION); LongWriter lastPosWriter = isOverwrite ? null : LongFineIoWriter.build(lastPosLocation, true); LongReader lastPosReader = isOverwrite ? null : LongFineIoReader.build(lastPosLocation); return new BaseByteArrayWriter(contentWriter, positionWriter, lengthWriter, isOverwrite, lastPosWriter, lastPosReader); }  static ByteArrayWriter build(URI location, boolean isOverwrite);  }