Package org.gnome.soup
Class Range
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.soup.Range
- All Implemented Interfaces:
Proxy
Represents a byte range as used in the Range header.
If end is non-negative, then start and end represent the bounds
of of the range, counting from 0. (Eg, the first 500 bytes would be
represented as start = 0 and end = 499.)
If end is -1 and start is non-negative, then this represents a
range starting at start and ending with the last byte of the
requested resource body. (Eg, all but the first 500 bytes would be
start = 500, and end = -1.)
If end is -1 and start is negative, then it represents a "suffix
range", referring to the last -start bytes of the resource body.
(Eg, the last 500 bytes would be start = -500 and end = -1.)
-
Constructor Summary
ConstructorsConstructorDescriptionRange()Allocate a new Range.Range(long start, long end) Allocate a new Range with the fields set to the provided values.Allocate a new Range with the fields set to the provided values.Allocate a new Range.Range(MemorySegment address) Create a Range proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.longreadEnd()Read the value of the fieldend.longRead the value of the fieldstart.voidwriteEnd(long end) Write a value in the fieldend.voidwriteStart(long start) Write a value in the fieldstart.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Range
Create a Range proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Range
Allocate a new Range.- Parameters:
arena- to control the memory allocation scope
-
Range
public Range()Allocate a new Range. The memory is allocated withArena.ofAuto(). -
Range
Allocate a new Range with the fields set to the provided values.- Parameters:
start- value for the fieldstartend- value for the fieldendarena- to control the memory allocation scope
-
Range
public Range(long start, long end) Allocate a new Range with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
start- value for the fieldstartend- value for the fieldend
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readStart
public long readStart()Read the value of the fieldstart.- Returns:
- The value of the field
start
-
writeStart
public void writeStart(long start) Write a value in the fieldstart.- Parameters:
start- The new value for the fieldstart
-
readEnd
public long readEnd()Read the value of the fieldend.- Returns:
- The value of the field
end
-
writeEnd
public void writeEnd(long end) Write a value in the fieldend.- Parameters:
end- The new value for the fieldend
-