Package org.gnome.soup
Class Range
java.lang.Object
io.github.jwharm.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
ConstructorDescriptionRange()
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 MemoryLayout
The memory layout of the native struct.long
readEnd()
Read the value of the fieldend
.long
Read the value of the fieldstart
.void
writeEnd
(long end) Write a value in the fieldend
.void
writeStart
(long start) Write a value in the fieldstart
.Methods inherited from class io.github.jwharm.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 fieldstart
end
- value for the fieldend
arena
- 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 fieldstart
end
- 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
-