private byte[] getContentRangeHeader(ResourceRegion region) { long start = region.getPosition(); long end = start + region.getCount() - 1; OptionalLong contentLength = contentLength(region.getResource()); if (contentLength.isPresent()) { long length = contentLength.getAsLong(); return getAsciiBytes("Content-Range: bytes " + start + '-' + end + '/' + length + "\r\n\r\n"); } else { return getAsciiBytes("Content-Range: bytes " + start + '-' + end + "\r\n\r\n"); } }
private byte[] getContentRangeHeader(ResourceRegion region) { long start = region.getPosition(); long end = start + region.getCount() - 1; OptionalLong contentLength = contentLength(region.getResource()); if (contentLength.isPresent()) { long length = contentLength.getAsLong(); return getAsciiBytes("Content-Range: bytes " + start + '-' + end + '/' + length + "\r\n\r\n"); } else { return getAsciiBytes("Content-Range: bytes " + start + '-' + end + "\r\n\r\n"); } }
private Flux<DataBuffer> getRegionSuffix(DataBufferFactory bufferFactory, String boundaryString) { byte[] endBoundary = getAsciiBytes("\r\n--" + boundaryString + "--"); return Flux.defer(() -> Flux.just( bufferFactory.allocateBuffer(endBoundary.length).write(endBoundary))); }
private Flux<DataBuffer> getRegionSuffix(DataBufferFactory bufferFactory, String boundaryString) { byte[] endBoundary = getAsciiBytes("\r\n--" + boundaryString + "--"); return Flux.defer(() -> Flux.just( bufferFactory.allocateBuffer(endBoundary.length).write(endBoundary))); }
byte[] startBoundary = getAsciiBytes("\r\n--" + boundaryString + "\r\n"); byte[] contentType = (mimeType != null ? getAsciiBytes("Content-Type: " + mimeType + "\r\n") : new byte[0]);
byte[] startBoundary = getAsciiBytes("\r\n--" + boundaryString + "\r\n"); byte[] contentType = (mimeType != null ? getAsciiBytes("Content-Type: " + mimeType + "\r\n") : new byte[0]);
private byte[] getContentRangeHeader(ResourceRegion region) { long start = region.getPosition(); long end = start + region.getCount() - 1; OptionalLong contentLength = contentLength(region.getResource()); if (contentLength.isPresent()) { long length = contentLength.getAsLong(); return getAsciiBytes("Content-Range: bytes " + start + '-' + end + '/' + length + "\r\n\r\n"); } else { return getAsciiBytes("Content-Range: bytes " + start + '-' + end + "\r\n\r\n"); } }
private byte[] getContentRangeHeader(ResourceRegion region) { long start = region.getPosition(); long end = start + region.getCount() - 1; OptionalLong contentLength = contentLength(region.getResource()); if (contentLength.isPresent()) { long length = contentLength.getAsLong(); return getAsciiBytes("Content-Range: bytes " + start + '-' + end + '/' + length + "\r\n\r\n"); } else { return getAsciiBytes("Content-Range: bytes " + start + '-' + end + "\r\n\r\n"); } }
private Flux<DataBuffer> getRegionSuffix(DataBufferFactory bufferFactory, String boundaryString) { byte[] endBoundary = getAsciiBytes("\r\n--" + boundaryString + "--"); return Flux.defer(() -> Flux.just( bufferFactory.allocateBuffer(endBoundary.length).write(endBoundary))); }
private Flux<DataBuffer> getRegionSuffix(DataBufferFactory bufferFactory, String boundaryString) { byte[] endBoundary = getAsciiBytes("\r\n--" + boundaryString + "--"); return Flux.defer(() -> Flux.just( bufferFactory.allocateBuffer(endBoundary.length).write(endBoundary))); }
byte[] startBoundary = getAsciiBytes("\r\n--" + boundaryString + "\r\n"); byte[] contentType = (mimeType != null ? getAsciiBytes("Content-Type: " + mimeType + "\r\n") : new byte[0]);
byte[] startBoundary = getAsciiBytes("\r\n--" + boundaryString + "\r\n"); byte[] contentType = (mimeType != null ? getAsciiBytes("Content-Type: " + mimeType + "\r\n") : new byte[0]);